原因: root@%表示 root用户通过任意其他端访问操作被拒绝!
授权即可:给用户添加CREATE,DROP权限。
可以查看用户授权信息:show grants;
mysql> show grants;
+----------------------------------------------------------------------------------------------------------------------------------------+
| Grants for root@localhost |
+----------------------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*81F5E21E35407D884A6CD4A731AEBFB6AF209E1B' WITH GRANT OPTION |
| GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION |
+----------------------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)
Mysql命令:
mysql> grant all privileges on *.* to 'root'@'%' identified by 'xxx此处为密码xxx' with grant option;
Query OK, 0 rows affected (0.00 sec)
--刷新权限
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
重启mysql容器,重新root客户端登录,Navicat可以操作新增删除操作了。
标签:1142,GRANT,create,denied,Navicat,sec,mysql,root,0.00 From: https://www.cnblogs.com/reallife/p/17288239.html