创建用户仅能把自己已有的权限赋给新用户,所以本身不是 ALL PRIVILEGES 权限的root无法再创建 ALL PRIVILEGES 权限的其他用户。
我们可以通过修改 mysql.user 权限表,把若干列等于'N'的字段改成'Y'即可。
2.mysql云实例root授权ALL PRIVILEGES
查看当前云数据库root有哪些权限不是Y,找出值为N的列,对其修改为Y
1 2 3 4 5 6 7 8 9 10 11 12
# 查看权限表 mysql > select * from mysql.user where user='root' and HOST='%'\G
# 找到值为N的列,改其为Y mysql > update mysql.user set Shutdown_priv='Y'where User='root' and HOST='%'; ## root用户获得Super权限 mysql > update mysql.user set Super_priv='Y'where User='root' and Host='%';
3.ERROR 1290 (HY000): The MySQL server is running with the –user-secure-priv option so it cannot execute this statement
修改报错
1 2
MySQL [(none)]> update mysql.user set Super_priv='Y'where User='admin' and Host='%'; ERROR 1290 (HY000): The MySQL server is running with the --user-secure-priv option so it cannot execute this statement