使用navicat 链接MySQL,出现这样的报错:
解决办法:
在服务器上登录mysql ,并且进入 use mysql:
root@localhost 09:07: [mysql]> update user set host = '%' where user = 'root';
Query OK, 1 row affected (0.07 sec)
root@localhost 09:12: [mysql]> flush privileges;
Query OK, 0 rows affected (0.02 sec)
然后再次使用navicat链接出现:
解决办法:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'yourpassword' WITH GRANT OPTION
root@localhost 09:13: [mysql]> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'yourpassword' WITH GRANT OPTION;
Query OK, 0 rows affected, 1 warning (0.02 sec)
root@localhost 09:14: [mysql]> flush privileges;
Query OK, 0 rows affected (0.02 sec)
综上:出现这类错误大概是是数据库当中mysql 中root 用户,设置的权限的问题
希望对你有所帮助