今天为创建的tom用户授予相关权限提示如下错误:
mysql> grant select,insert,update,delete on test.* to tom@localhost;
ERROR 1410 (42000): You are not allowed to create a user with GRANT
产生用户不能授权的原因是mysql 数据库中user 表中的特定用户(root) 的host 的属性值为localhost.
解决办法如下:
使用mysql 数据库
mysql> use mysql;
特定用户的host 修改
mysql> update user set host=’%’ where user=‘root’;
指定用户的授权
mysql> grant all privileges on test.* to root@’%’;
mysql> grant select,insert,update,delete on test.* to tom@’%’;