日期:2014-05-16  浏览次数:20691 次

mysql root 用户不能授权
D:\MySQL Server 5.1_3307\bin>mysql -uroot -p -P3307
Enter password: **********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.1.48-community-log MySQL Community Server (GPL)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

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

mysql> create database test1;
Query OK, 1 row affected (0.00 sec)

mysql> grant all on *.* to game@'%' identified by '123456';
ERROR 1045 (28000): Access denied for user 'root'@'%' (using password: YES)
mysql>



以上为操作记录 我用root进入数据库,什么权限都有,但是在授权给别的用户的时候报错,谁碰到过这种问题,求高手解答,

------解决方案--------------------
root@%的权限是不是all privileges,而是单个组合起来的,所以也就不能给别人赋all的权限
------解决方案--------------------
引用ERROR 1045 (28000): Access denied for user 'root'@'%' (using password: YES)