背景
本地安装了mysql,很久没启动了,今天启动以后,报错:Client does not support authentication protocol requested by server。
解决方案:
在在开始程序里,搜索mysql,找到如下程序,启动。输入密码。初始密码一般为root。
再使用如下命令:
mysql> use mysql;
mysql> alter user 'root'@'localhost' identified with mysql_native_password by 'root';
Query OK, 0 rows affected (0.14 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.03 sec)
完美解决,收工。