1. In order to enhance security, MySQL5.7 a randomly generated password for the root, in the error log, the position error log on, and if the RPM package installation, the default is /var/log/mysqld.log.
MySQL can get a temporary password by # grep "password" /var/log/mysqld.log command
MySQL can get a temporary password by # grep "password" /var/log/mysqld.log command
2016-01-19T05:16:36.218234Z 1 [Note] A temporary password is generated for root@localhost: waQ,qR%be2(5
This is the password
Then log on.
The password used to log in to the server, the password must be changed immediately, otherwise it will report the following error:
But be careful password required high complexity, it is difficult to find the right password in the case of the blind set up so everyone at the table refer to:
SHOW VARIABLES LIKE 'validate_password%'; lookup statement
A set global validate_password_xxxxx = xx; set password rules
Then ALTER USER 'root' @ 'localhost' IDENTIFIED BY 'root'; Change password.