代码语言:javascript复制MySQL root用户不能为普通用户赋权限, 报错:Error Code: 1044. Access denied for user ‘root’@’%’ to database
mysql> select host,user,password,Grant_priv,Super_priv FROM mysql.user;
-------------- --------- ------------------------------------------- ------------ ------------
| host | user | Grant_priv | Super_priv |
-------------- --------- ------------------------------------------- ------------ ------------
| 192.168.10.% | zzh | N | Y |
| 192.168.10.% | he | N | Y |
| 192.168.10.% | root | Y | Y |
| localhost | sdvv | N | N |
| localhost | root | Y | Y |
| % | root | N | Y |
| 127.0.0.1 | root | Y | Y |
| % | sdvv | N | Y |
-------------- --------- ------------------------------------------- ------------ ------------
可以看到root远程授权的权限没有打开:
代码语言:javascript复制 % | root | N
赋值一下权限即可。
代码语言:javascript复制update mysql.user set Grant_priv='Y', Super_priv='Y' where User='root';
flush privileges;