MySQL在Centos6(和其他發行版IIRC)初始化多個超級用戶(其中host.domain是我的主機名):在MySQL中,[email protected]'my.host'和[email protected]'127.0.0.1'的用途是什麼?
select User,Host,Password from mysql.user where User = 'root';
+------+-------------+-------------------------------------------+
| User | Host | Password |
+------+-------------+-------------------------------------------+
| root | localhost | *2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19 |
| root | host.domain | *2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19 |
| root | 127.0.0.1 | *2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19 |
+------+-------------+-------------------------------------------+
我不明白的[email protected]'host.domain'和根的目的@ '127.0.0.1'條目。在什麼情況下是本地主機連接的主機而不是'localhost'?我認爲所有本地連接都是從'localhost'解釋的。
試試這個:http://stackoverflow.com/questions/3715925/localhost-vs-127-0-0-1 –