mysql> show variables like "%validate_password%";
+--------------------------------------+--------+
| Variable_name | Value |
+--------------------------------------+--------+
| validate_password_check_user_name | OFF |
| 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 |
+--------------------------------------+--------+
mysql> set global validate_password_policy=LOW:
mysql> set global validate_password_length=4;
修改密码允许远程访问
```
update mysql.user set authentication_string=password("root") where user="root";
update mysql.user set host="%" where user="root";
flush privileges;
```
mysql5.7以后:mysql.user表中没有了password字段,而是使用authentication_string来代替。
mysql5.7之前:update mysql.user set password=password("123456") where user="root";(修改root的密码);
可能出现的问题:
mysql server启动失败,查看datadir的所属用户和所属组,如果不是mysql:mysql,修改权限。 chown -R mysql:mysql /var/lib/mysql