mysql支持sha2吗_Mysql 8.0新特性--caching_sha2_password

Mysql8.0中默认的密码验证插件变化了,之前是mysql_native_password,现在是caching_sha2_password。caching_sha2_password提供了更好的性能和更高的密码安全性。

如果mysql版本太低会无法连接到Mysql8.0。报错:

https://www.cndba.cn/Expect-le/article/3087

https://www.cndba.cn/Expect-le/article/3087

ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/local/mysql/lib/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory

https://www.cndba.cn/Expect-le/article/3087

The libmysqlclient client library in MySQL 8.0 (8.0.4 or higher). Standard MySQL clients such as mysql and mysqladmin are libmysqlclient-based, so they are compatible as well.

The libmysqlclient client library in MySQL 5.7 (5.7.23 or higher). Standard MySQL clients such as mysql and mysqladmin are libmysqlclient-based, so they are compatible as well.

MySQL Connector/C++ 1.1.11 or higher or 8.0.7 or higher.

MySQL Connector/J 8.0.9 or higher.

MySQL Connector/NET 8.0.10 or higher (through the classic MySQL protocol).

MySQL Connector/Node.js 8.0.9 or higher.

PHP: the X DevAPI PHP extension (mysql_xdevapi) supports caching_sha2_password.

而如果你的客户端版本低于5.7.23,而连接用户又使用了默认的密码验证插件,那么就无法通过该用户连接,只能修改该用户的密码验证插件。

https://www.cndba.cn/Expect-le/article/3087

解决方法如下:https://www.cndba.cn/Expect-le/article/3087

1)

修改某个用户的验证插件

ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root';

https://www.cndba.cn/Expect-le/article/3087

flush privileges;

2)

初始化数据库时,也可以修改默认插件

https://www.cndba.cn/Expect-le/article/3087

bin/mysql –initialize--default-authentication-plugin=mysql_native_password

3)

【推荐】修改配置文件

[mysqld]

https://www.cndba.cn/Expect-le/article/3087https://www.cndba.cn/Expect-le/article/3087

default_authentication_plugin=mysql_native_password

版权声明:本文为博主原创文章,未经博主允许不得转载。

caching_sha2_password

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值