远程登陆时报错: Authentication plugin 'caching_sha2_password' cannot be loaded
- # MySQL -h x.x.x.x -u username -p
- Enter password:
- ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib64/MySQL/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory
解决方法:
- CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
- GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' WITH GRANT OPTION;
- CREATE USER 'username'@'%' IDENTIFIED BY 'password';
- GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' WITH GRANT OPTION;
- ALTER USER 'username'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
- ALTER USER 'username'@'%' IDENTIFIED WITH mysql_native_password BY 'password';
- FLUSH PRIVILEGES;
注: 请自行替换其中的 username 和 password .
参考:
来源: http://www.bubuko.com/infodetail-3458112.html