SQLyog连接不上mysql
问题描述
用SQLyog或navicat连接不上,原因是mysql8.0 引入了新特性 caching_sha2_password;这种密码加密方式客户端不支持;客户端支持的是mysql_native_password 这种加密方式。
方法一:改表
使用命令将他修改成mysql_native_password加密模式,如下:
mysql> select host,user,plugin from user;
mysql> updates user set plugin='mysql_native_password' where user='root';
mysql> select host,user,plugin from user;
方法二:授权
mysql> grant all privileges on *.* to 'root'@'%';
mysql> alter user 'root'@'%' identified with mysql_native_password by '123456';
mysql> flush privileges;


浙公网安备 33010602011771号