爲什麼哦爲什麼我不能連接到mysql?錯誤1130(HY000):主機''不允許連接到這個MySQL服務器
mysql -u root -ptest101 -h xxx.xxx.xxx.xxx
ERROR 1130 (HY000): Host 'xxx.xxx.xxx.xxx' is not allowed to connect to this MySQL server
在my.cnf我有以下
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 0.0.0.0
我也跑了下面......
'UPDATE mysql.user SET Password = PASSWORD('test101') WHERE User = 'root';
FLUSH PRIVILEGES;
我可以在主機上用mysql -u root訪問權限 - ptest101但不使用mysql -u root -ptest101 -h xxx.xxx.xxx.xxx
哇......爲什麼會發生這種情況?我ñubuntj 12.04
mysql> SELECT host FROM mysql.user WHERE User = 'root';
+---------------------------------------------+
| host |
+---------------------------------------------+
| % |
| 127.0.0.1 |
| ::1 | |
| localhost |
+---------------------------------------------+
5 rows in set (0.00 sec)
請記住,mysql帳戶不只是用戶名。它們是'user @ host'對,其中任一對都可以是通配符。您可能正在使用正確的用戶名,但是您是否授予了正確的主機權限? –