重庆思庄Oracle、Redhat认证学习论坛

标题: caching_sha2_password与mysql_native_password区别? [打印本页]

作者: 郑全    时间: 2023-1-6 15:23
标题: caching_sha2_password与mysql_native_password区别?
本帖最后由 郑全 于 2023-1-6 15:30 编辑

mysql8.0.4 以前MYSQL使用 MYSQL_NATIVE_PASSWORD 插件用于口令的验证,从 MYSQL8.0.4,caching_sha2_password成为默认的身份认证插件。

应该说 caching_sha2_password 比 mysql_native_password 更安全,

mysql_native_password  使用 sha1,不用SALT, 2轮哈希

caching_sha2_password 使用 sha256,使用20字节 SALT,5000轮哈希。

用户到底用的什么,可以通过以下语句查看:

select user,host,plugin from mysql.user;

要查看默认值:
mysql> show variables like 'default_auth%';
+-------------------------------+-----------------------+
| Variable_name                 | Value                 |
+-------------------------------+-----------------------+
| default_authentication_plugin | caching_sha2_password |
+-------------------------------+-----------------------+
1 row in set (0.00 sec)








欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/) Powered by Discuz! X3.2