刚装了mysql8.0,用navicat登陆不了,点击“打开连接”出现2059错误。
查找太多的解决方法,后来用命令行登陆解决了此问题。
1、找到MySql目录下的配置文件my.ini(C:\ProgramData\MySQL\MySQL Server 8.0)
增加default_authentication_plugin=mysql_native_password
或
将default_authentication_plugin=caching_sha2_password改为default_authentication_plugin=mysql_native_password
2、打开cmd系统命令,用命令行登陆
mysql -u root -p
Enter password:xxxxx
3、use mysql
4、ALTER USER ‘root’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘root’;
5、flush privileges;
6、可以用navicat登录了