应该是: grant all on *.* to 'user@host' identified by 'password';
or grant all on *.* to 'user@IP' identified by 'password';
默认的情况下,mysql.user 里有一个root用户,它的主机是"localhost",如果你允许远程登录的话它就会新建一个root用户,它对应的主机为"%",见下面:mysql> select user,host from mysql.user;
+------+-----------+
| user | host |
+------+-----------+
| root | % |
| root | localhost |
+------+-----------+
2 rows in set (0.13 sec)所以你不能把root用户的主机全部改成"%".
or grant all on *.* to 'user@IP' identified by 'password';
默认的情况下,mysql.user 里有一个root用户,它的主机是"localhost",如果你允许远程登录的话它就会新建一个root用户,它对应的主机为"%",见下面:mysql> select user,host from mysql.user;
+------+-----------+
| user | host |
+------+-----------+
| root | % |
| root | localhost |
+------+-----------+
2 rows in set (0.13 sec)所以你不能把root用户的主机全部改成"%".
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货