[root@localhost ~]#sudo grep 'temporary password' /var/log/mysqld.log 2016-07-18T13:05:55.127511Z 1 [Note] A temporary password is generated for root@localhost: mG8%E;mB3ykC
mG8%E;mB3ykC即为root的密码
用这个密码登陆到mysql,并修改密码,若密码比较简单,如‘123456’
会出现错误
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
密码不符合要求,更改密码策略,降低密码的验证标准
--更改密码策略为LOW 并更改密码长度
mysql> set global validate_password_policy=0; Query OK, 0 rows affected (0.00 sec)
mysql> set global validate_password_length=4; Query OK, 0 rows affected (0.00 sec)--查看现有的密码策略
mysql> SHOW VARIABLES LIKE 'validate_password%'; +--------------------------------------+-------+ | Variable_name | Value | +--------------------------------------+-------+ | validate_password_dictionary_file | | | validate_password_length | 4 | | validate_password_mixed_case_count | 1 | | validate_password_number_count | 1 | | validate_password_policy | LOW | | validate_password_special_char_count | 1 | +--------------------------------------+-------+ 6 rows in set (0.31 sec)
设置后修改密码
[root@localhost ~]# mysql_secure_installation Securing the MySQL server deployment. Enter password for user root: The existing password for the user account root has expired. Please set a new password. New password: Re-enter new password:参考
http://blog.csdn.net/maxsky/article/details/51171474
解决 MySQL 5.7 中 Your password does not satisfy the current policy requirements. 问题
http://blog.itpub.net/26506993/viewspace-2062622
MySQL 5.7 密码安全策略简介