数据库 Mysql GRANT 出错

hiveer · 2014年02月25日 · 最后由 xfwduke 回复于 2014年03月02日 · 2733 次阅读
mysql> show grants;
+-------------------------------------------------------------------------------+
| Grants for root@localhost                                                     |
+-------------------------------------------------------------------------------+
| GRANT SELECT, INSERT, UPDATE ON *.* TO 'root'@'localhost'                     |
| GRANT ALL PRIVILEGES ON `TESTSTRAP`.* TO 'root'@'localhost' WITH GRANT OPTION |
+-------------------------------------------------------------------------------+
mysql> GRANT DELETE ON *.* TO 'root'@'localhost';
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
mysql> select password from mysql.user where user='root';
+----------+
| password |
+----------+
|          |
+----------+
1 row in set (0.00 sec)

root 用户没有密码,但是在 GRANT 的时候提示 using password: NO

root 账号只能对 TESTSTRAP 库做权限扩散 你的授权是对 *.*, 所以是没有权限

需要 登录 后方可回复, 如果你还没有账号请 注册新账号