mysql8.0 Navicat远程连接报错解决

首先修改成免密码登录mysql

  1. vim /etc/my.cnf

在my.cnf最后加上如下语句 然后保存退出

        skip-grant-tables

  将default_authentication_plugin=caching_sha2_password改为default_authentication_plugin=mysql_native_password

重启mysql服务

        service mysql restart

登录mysql

    mysql -uroot -p

执行以下命令

    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';

然后设置密码

        ALET suer 'root'@'localhost' IDENTIFIED BY 'newPassword';

        flush privileges;

退出mysql 将刚刚在my.cof最后加的代码删除

 重启mysql

        service mysql restart

Navicat 再次链接 OK了 

    






猜你喜欢

转载自blog.csdn.net/qq_35375177/article/details/80343397