关于由于版本号码不同而引起的 Client does not support authentication protocol requested by server 问题

Created at 2018-05-07 Updated at 2018-06-04 Category Study Tag MySQL

搜索类似的问题,得到的答案类似于下面

mysql>SET PASSWORD FOR
‘root‘@’localhost’ = OLD_PASSWORD(‘newpassword’);

但是这些方法试了之后都是会提示语法的错误,如下:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘odl_password(‘123456’)’ at line 1

为此东找西找,发现了一个适用的方法:

ALTER USER ‘root‘@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘你的密码’;
FLUSH PRIVILEGES;

这样之后 ,客户端就突然连接上了服务器

解锁用户

ALTER USER ‘furrywall‘@’localhost’ ACCOUNT UNLOCK;


共勉

Table of Content

愿你是你所期待的样子

愿你还是你所期待的样子

Hide