在MySQL 8中,默认的密码策略进行了调节,这篇文章介绍调节和设定的方法。
环境说明
- 操作系统版本: 10.15.2
liumiaocn:target liumiao$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.15.2
BuildVersion: 19C57
liumiaocn:target liumiao$
- MySQL版本: 8.0.11
liumiaocn:target liumiao$ mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 46
Server version: 8.0.11 Homebrew
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
- MySQL运行状态
liumiaocn:target liumiao$ mysql.server status
SUCCESS! MySQL running (4633)
liumiaocn:target liumiao$
问题现象
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'liumiao123';
ERROR 1819 (HY000): Your password does not satisfy the current policy r