在MySQL5.7中可以使用
mysql> set global validate_password_policy=0;
mysql> set global validate_password_length=1;
在MySQL8中得先休修改一个符合要求的密码例如:ROOT_root_12
然后修改密码等级
# 得先修该密码否则
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'ROOT_root_12';
Query OK, 0 rows affected (0.01 sec)
mysql> set global validate_password.policy=0;
Query OK, 0 rows affected (0.01 sec)
mysql> set global validate_password.length=1;
Query OK, 0 rows affected (0.00 sec)
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '000000';
Query OK, 0 rows affected (0.01 sec)