Mysql5.7 The new root password rule

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.