Mybatis连接mysql问题记录

配置Mybatis环境时,连接mysql出现下面错误:

1 Client does not support authentication protocol requested by server; consider upgrading MySQL client

通过网上如下方法,恢复成功:

(1)Windows系统中,使用cmd连接mysql数据库。

mysql -h localhost -u root -p mysql

(2)输入数据库密码,登录成功后,执行如下语句后问题解决:

1 use mysql;
2 ALTER USER ‘root’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘newpwd’; 
3 FLUSH PRIVILEGES;

其中第二句中,root是用户名、localhost是数据库地址、newpwd是新密码。

猜你喜欢

转载自www.cnblogs.com/Mmumu/p/9165407.html
今日推荐