wget https://github.com/jedisct1/libsodium/releases/download/1.0.16/libsodium-1.0.16.tar.gz
tar xf libsodium-1.0.16.tar.gz && cd libsodium-1.0.16
./configure && make -j2 && make install
echo /usr/local/lib > /etc/ld.so.conf.d/usr_local_lib.confldconfig
error: Failed dependencies:
libmysqlclient.so.18()(64bit) is needed by (installed) postfix-2:2.10.1-6.el7.x86_64
libmysqlclient.so.18()(64bit) is needed by (installed) perl-DBD-MySQL-4.023-5.el7.x86_64
libmysqlclient.so.18()(64bit) is needed by (installed) php-mysql-5.4.16-36.3.el7_2.x86_64
libmysqlclient.so.18(libmysqlclient_18)(64bit) is needed by (installed) postfix-2:2.10.1-6.el7.x86_64
libmysqlclient.so.18(libmysqlclient_18)(64bit) is needed by (installed) perl-DBD-MySQL-4.023-5.el7.x86_64
libmysqlclient.so.18(libmysqlclient_18)(64bit) is needed by (installed) php-mysql-5.4.16-36.3.el7_2.x86_64
mariadb-libs(x86-64) = 1:5.5.50-1.el7_2 is needed by (installed) mariadb-1:5.5.50-1.el7_2.x86_64
mariadb-libs(x86-64) = 1:5.5.50-1.el7_2 is needed by (installed) mariadb-server-1:5.5.50-1.el7_2.x86_64
mysql-connectors-community/x86_64 MySQL Connectors Community 65
mysql-tools-community/x86_64 MySQL Tools Community 69
mysql80-community/x86_64 MySQL 8.0 Community Server 33
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '123456789';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
远程连接授权
mysql> use mysql;
mysql> select user,host from user;
mysql> update user set host = '%' where user = 'root';
重启MySQL
[root@centos ~]# systemctl restart mysqld;
Mysql 安装完客户端连接报错:“Authentication plugin ‘caching_sha2_password’ cannot be loaded: ”
意思是客户端不支持caching_sha2_password的加密方式。
这样是不是就可以了呢? 其实并不会,还有一个坑
执行命令
use mysql;
select user,plugin from user ;
可以看到root用户的加密方式为caching_sha2_password
这样的话有两种办法可以解决问题:
一、升级客户端支持caching_sha2_password方式,没有采用。
我使用第二种方法:
二、修改密码加密方式,改成mysql_native_password
# 注意这里’%’是因为我们刚刚把user表中的localhost换成了%
ALTERUSER'root'@'%'IDENTIFIED BY'password'PASSWORD EXPIRE NEVER;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
FLUSH PRIVILEGES;
# 查看一下现在的user表
select host, user, authentication_string, plugin from user;