CentOS7 安装MySQL8,用/var/log/mysql.log中搜索到的初始密码登录后,执行'alter user 'root'@'localhost' identified by 'PASSQORD' 修改密码时提示'Your password does not satisfy the current policy requirements'.
先设定一个比较复杂的密码,包含大小写字母,特殊符号,数字。然后查看相关的密码设定。
CentOS7 安装MySQL8 后可以查到'validate_password'相关的变量:
但Ubuntu18安装同样的版本却没有类似信息
原因是Ubuntu18 下MySQL8 未安装validate_password插件。可以执行以下命令来安装或卸载:
INSTALL COMPONENT 'file://component_validate_password';
UNINSTALL COMPONENT 'file://component_validate_password';
各项参数的说明:https://dev.mysql.com/doc/refman/8.0/en/validate-password-options-variables.html
参考:https://dev.mysql.com/doc/refman/8.0/en/validate-password-installation.html