[Warning] [MY-013360] [Server] Plugin sha256_password reported: ''sha256_password' is deprecated and will be removed in a future release. Please use caching_sha2_password instead'
是 MySQL 8.0+ 中的一个警告信息,说明你当前使用的身份验证插件 sha256_password 已被弃用(deprecated),官方建议改用更安全、性能更好的 caching_sha2_password。
sha256_password:
MySQL 5.7 引入的一种基于 SHA-256 的认证插件,支持 TLS 加密连接下的安全密码验证。
caching_sha2_password:
MySQL 8.0 的默认认证插件,在安全性相当的前提下,通过缓存机制提升了重复连接的性能,并支持非 TLS 连接下的 RSA 加密密码交换。
✅ 自 MySQL 8.0 起,新创建的用户默认使用
caching_sha2_password。
caching_sha2_password(推荐)-- 查看哪些用户还在用 sha256_password SELECT User, Host, plugin FROM mysql.user WHERE plugin = 'sha256_password'; -- 修改用户认证方式(以 'your_user'@'host' 为例) ALTER USER 'your_user'@'host' IDENTIFIED WITH caching_sha2_password BY 'your_password';
⚠️ 修改后,确保你的客户端驱动支持
caching_sha2_password(MySQL 8.0 官方驱动、MariaDB Connector/J 2.7+、PHP 7.4+ 等均支持)。⚠️ PHP 7.3以下不支持caching_sha2_password
最新评论: