问题描述:我在使用阿里的datav服务时候,连接服务器的MySQL数据库连不上去呀!是这么一个错误
ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; con......
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
// 'password'是你的数据库密码
上面办法虽然可以解决问题,但是我还是报错了:
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your password';
ERROR 1396 (HY000): Operation ALTER USER failed for 'root'@'localhost'
所以继续解决bug:
use mysql;
select user,host from user;
注意我的root,host是’%’
所以你要把:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your password';
localhost => %
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'your password';
ok了。datav里面加进去了,谢谢观看!