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


部署docker下的mysql時出現以下報錯

[root@docker ~]# mysql -h192.168.30.22 -uroot -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

原因應該是mysql版本問題

解決方案

[root@docker ~]# docker exec -it lnmp_mysql bash

root@63259bee4195:/#  mysql -uroot -p123456

mysql> alter user 'root'@'%' identified with mysql_native_password by 'root';

Query OK, 0 rows affected (0.04 sec)

[root@docker ~]# mysql -h192.168.30.22 -uroot -p

Enter password:

Welcome to the MariaDB monitor.  Commands end with ; or \g.

Your MySQL connection id is 22

Server version: 8.0.16 MySQL Community Server - GPL

 

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

 

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

 

MySQL [(none)]> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| mysql              |

| performance_schema |

| sys                |

| wp                 |

+--------------------+

5 rows in set (0.02 sec)


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM