mysql.user表中的127.0.0.1,localhost,[hostname]有什么区别
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了mysql.user表中的127.0.0.1,localhost,[hostname]有什么区别,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1469字,纯文字阅读大概需要3分钟。
内容图文
下面是查询选择主机的结果,来自mysql.user的用户来自全新安装的MySQL 5.
+-----------+------------------+
| host | user |
+-----------+------------------+
| 127.0.0.1 | root |
| localhost | debian-sys-maint |
| localhost | root |
| ubuntu | root |
+-----------+------------------+
127.0.0.1,localhost和ubuntu都指向同一台机器,即本地主机.从表中删除具有看似重复的主机/用户对的行后,我找不到任何差异.
这些有什么区别?我可以安全地删除其他两个吗?
解决方法:
从the manual开始:
When you install MySQL, the grant tables are populated with an initial
set of accounts. The names and access privileges for these accounts
are described in Section 2.10.3, “Securing the Initial MySQL
Accounts”, which also discusses how to assign passwords to them.
Some accounts have the user name root. These are superuser accounts
that have all privileges and can do anything. The initial root account
passwords are empty, so anyone can connect to the MySQL server as root
without a password and be granted all privileges.On Unix, each root account permits connections from the local
host. Connections can be made by specifying a host name of localhost
or the actual host name or IP address.
但是,我找不到任何理由.手册中的其他地方没有任何内容表明这是出于任何特殊原因所必需的,但可能是为了涵盖request verification的所有基础.可能存在一些原始本地连接使用一个帐户而另一些需要使用替代方案的情况;我想已经决定确保本地root访问将始终有效,无论边缘情况如何,都是好事.
内容总结
以上是互联网集市为您收集整理的mysql.user表中的127.0.0.1,localhost,[hostname]有什么区别全部内容,希望文章能够帮你解决mysql.user表中的127.0.0.1,localhost,[hostname]有什么区别所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。