mysql > grant all privileges on test.* to root@'%'
提示的错误信息如下:You are not allowed to create a user with GRANT;
产生用户不能授权的原因是mysql 数据库中user 表中的特定用户(root) 的host 的属性值为localhost.
mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> update user set host='%' where user='root';
Query OK, 1 row affected (0.02 sec)
Rows matched: 1 Changed: 1 Warnings: 0
# 使用mysql 数据库
mysql > use mysql;
# 特定用户的host 修改
mysql > update user set host='%' where user='root';
# 指定用户的授权
mysql > grant all privileges on test.* to root@'%'
发表评论