Navicat远程无法创建数据库

六月ゝ 毕业季﹏ 提交于 2019-12-08 10:10:36

提示报错信息如下,说明是用户创建的权限不足。

Error Code: 1044. Access denied for user 'root'@'%' to database

打开宝塔面板的控制台,输入下面命令看到

mysql> SELECT host,user,password,Grant_priv,Super_priv FROM mysql.user;
+--------------+---------+-------------------------------------------+------------+------------+
| host         | user    | password                                  | Grant_priv | Super_priv |
+--------------+---------+-------------------------------------------+------------+------------+
| 192.168.28.% | oozie   | *FED29C14B2E900D70B11B1F1B370F953BA51A6A0 | N          | Y          |
| 192.168.28.% | hive    | *FED29C14B2E900D70B11B1F1B370F953BA51A6A0 | N          | Y          |
| 192.168.28.% | root    | *FED29C14B2E900D70B11B1F1B370F953BA51A6A0 | Y          | Y          |
| localhost    | ranger  | *84BB87F6BF7F61703B24CE1C9AA9C0E3F2286900 | N          | N          |
| localhost    | root    | 0                                         | Y          | Y          |
| %            | root    | *FED29C14B2E900D70B11B1F1B370F953BA51A6A0 | N          | Y          |
| 127.0.0.1    | root    | *FED29C14B2E900D70B11B1F1B370F953BA51A6A0 | Y          | Y          |
| %            | ranger  | *84BB87F6BF7F61703B24CE1C9AA9C0E3F2286900 | N          | Y          |
+--------------+---------+-------------------------------------------+------------+------------+

可以看到授权的权限没有打开: Grant_priv is set to N for root@%. 修复下

UPDATE mysql.user SET Grant_priv='Y', Super_priv='Y' WHERE User='root'; FLUSH PRIVILEGES;

重新登录下,就ok了。

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!