original articles, reproduced please specify the Source: Server non-amateur research http://blog.csdn.net/erlib author Sunface
Contact e-mail: [Email protected]
Today in the installation of mysql5.7.8 encountered some problems, the first is the initial root password changes, special sharing solution is as follows:
1. mysql5.7 generates an initial password, and the previous version does not need to be logged on for the first login.
Shell> Cat/root/.mysql_secret
# Password set for user ' [e-mail protected] ' at 2015-04-22 22:13:23
? g5w&tz1z.cn
2. If the first step succeeds, use this password to continue with the 7th step (the author can only start with the 3rd step because the file cannot be found)
3. Modify the MySQL configuration file (default is/ETC/MY.CNF) and add a line under [mysqld] skip-grant-tables
4.service mysqld Restart, you can enter it directly with MySQL
5.mysql> Update Mysql.user Set Authentication_string=password (' 123qwe ') where user= ' root ' and Host = ' localhost ';
mysql> flush Privileges;
Mysql> quit;
6. Restore the/etc/my.cnf file and restart Mysql:service mysql Restart, this time you can use Mysql-u root-p ' 123qwe ' to enter the
7.mysql>set PASSWORD = PASSWORD (' newpasswd '); Set a new password
To sum up: Want to taste, will pay the price!
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Mysql5.7 The new root password rule