- 论坛徽章:
- 0
|
原帖由 andrefun 于 2009-1-5 17:51 发表 ![]()
很简单,因为你没有grant权限。在创建root用户的时候,如果你要给他grant权限,要加上with GRANT OPTION的。
非常感谢,确实是因为这个原因
mysql> select user, grant_priv from user where user='root';
+------+------------+
| user | grant_priv |
+------+------------+
| root | N |
+------+------------+
1 row in set (0.00 sec)
mysql> update user set grant_priv='Y' where user='root';
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1 Changed: 0 Warnings: 0
mysql> select user, grant_priv from user where user='root';
+------+------------+
| user | grant_priv |
+------+------------+
| root | Y |
+------+------------+
1 row in set (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
# mysqld restart
mysql> grant all on *.* to 'root'@'localhost' identified by 'mypasswd';
Query OK, 0 rows affected (0.00 sec)
|
之前改过一次root的权限,但是给忘了,没想到改错了。 下次再进行数据库操作的时候就加上--tee了,要不找问题都不好找,多谢andrefun
[ 本帖最后由 wertyu 于 2009-1-5 19:09 编辑 ] |
|