一、参考安装方法:
https://blog.csdn.net/weixin_42067855/article/details/81808159
二、参考配置方法:
https://blog.csdn.net/weixin_42067855/article/details/81812226
如果使用的是mysql8.0以上的版本可能会遇到以下报错
mysql> alter user'root'@'localhost'identified by '1234aaaaaaaaa555bbb';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
说明密码不符合规范,由于8.0版本不支持直接修改validate-password变量所以我们可以先修改一个符合规范的密码再进行后续操作
mysql> alter user'root'@'localhost'identified by 'Root_2020root';
Query OK, 0 rows affected (0.00 sec)
然后查看validate-password变量
mysql> SHOW VARIABLES LIKE 'validate_password%';
+--------------------------------------+--------+
| Variable_name | Value |
+--------------------------------------+--------+
| validate_password.check_user_name | ON |
| validate_password.dictionary_file | |
| validate_password.length | 8 |
| validate_password.mixed_case_count | 1 |
| validate_password.number_count | 1 |
| validate_password.policy | MEDIUM |
| validate_password.special_char_count | 1 |
+--------------------------------------+--------+
7 rows in set (0.01 sec)
观察可以发现 validate_password.policy,其实造成修改错误的原因是因为 8.0以下的版本它们的名字是validate_password_policy
故,可以作如下修改后,完成密码修改工作。
mysql> set global validate_password.policy=0;
Query OK, 0 rows affected (0.00 sec)
mysql> set global validate_password.length=1;
Query OK, 0 rows affected (0.00 sec)
mysql> alter user'root'@'localhost'identified by '简单一点的密码‘
-> ;
Query OK, 0 rows affected (0.01 sec)
来源:CSDN
作者:weixin_38496887
链接:https://blog.csdn.net/weixin_38496887/article/details/104550199