解决mysql连接报错:1251-Client does not support authentication protocol requested by server;consider upgrading MYSQL client
使用navicat连接mysql8.0时报错:
1251-Client does not support authentication protocol requested by server;consider upgrading MYSQL client
错误原因
使用MySQL客户端Navicat连接数据库MySQL8.0,MySQL8.0 之前的版本中加密规则是mysql_native_password
,而MySQL8.0,加密规则是caching_sha2_password
解决方法是进入mysql的命令行执行语句:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你想设置的密码';
BY ‘你想设置的密码’;