Mysql授予所有权限未获得应用

时间:2011-09-24 19:17:30

标签: mysql

我发出以下命令以允许从任何主机登录

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'xxxx' WITH GRANT OPTION;
FLUSH PRIVILEGES;

但它没有更新?


mysql> show grants;
+----------------------------------------------------------------------------------------------------------------------------------------+
| Grants for root@localhost                                                                                                              |
+----------------------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*xxxxxxxxxxxxxxxxx33487256' WITH GRANT OPTION |
| GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION                                                                           |
+----------------------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

2 个答案:

答案 0 :(得分:4)

我怀疑是因为你在以root身份连接到localhost时发出了“show grants”命令。试试这个并查看返回的内容:

SHOW GRANTS FOR 'root'@'%';

如果没有显示任何内容,请查看mysql.user表,可能会有一个线索:

SELECT user, host FROM mysql.user;

答案 1 :(得分:0)

创建'pass'标识的用户'user'@'%'; 查询正常,0行受影响(0.00秒)

我做的是添加授权选项:) 使用grant选项将全部授予'user'@'%';

然后它开始工作应该是......

最好的问候, emrah benligil