gitava / Big-Data-Study

For studying big data
2 stars 0 forks source link

mysql - /usr/lib64/mysql/plugin/sha256_password.so: cannot open shared object file: No such file or directory #9

Closed gitava closed 4 years ago

gitava commented 4 years ago

try to remote log onto mysql server...get this error.

[vagrant@hdp-node-01 bin]$ mysql -h 192.168.33.102 -uhive-p
Enter password:
ERROR 2059 (HY000): Authentication plugin 'sha256_password' cannot be loaded: /usr/lib64/mysql/plugin/sha256_password.so: cannot open shared object file: No such file or directory
gitava commented 4 years ago

as per https://www.cnblogs.com/dobbin2018/p/9645872.html

分析:

  1)什么是caching_sha2_password?

  mysql的一个认证的插件——MySQL 8.0.4开始默认使用caching_sha2_password作为认证的插件,对于之前的版本的mysql,默认的认证插件为mysql_native_password。

解决方法:

  1)在mysql主机运行如下命令

  2)更改加密方式

ALTER USER 'master'@'%' IDENTIFIED WITH mysql_native_password BY 'MyNewPass!';   3)没了。

mysql> select host,user,plugin  from mysql.user;
+-----------+------------------+-----------------------+
| host      | user             | plugin                |
+-----------+------------------+-----------------------+
| %         | hive             | caching_sha2_password |
| localhost | mysql.infoschema | caching_sha2_password |
| localhost | mysql.session    | caching_sha2_password |
| localhost | mysql.sys        | caching_sha2_password |
| localhost | root             | caching_sha2_password |
+-----------+------------------+-----------------------+
5 rows in set (0.00 sec)

mysql> ALTER USER 'hive'@'%' IDENTIFIED WITH mysql_native_password BY '!mySQL123!';
Query OK, 0 rows affected (0.05 sec)

Problem solved!!!