Change Password in Mysql5.7,

Source: Internet
Author: User

Change Password in Mysql5.7,

No password is set when mysql5.7 is installed in Ubuntu. mysql-u root-p cannot be used to connect to the mysql service.

There are two ways to query data online:

1. For the first installation, mysql5.7 sets a default password to be stored in a directory. After logging on with the default password, a prompt will be prompted to change the password. This method has not been tried yet

2. modify the mysql configuration file sudo vim/etc/mysql. conf. d/mysqld. cnf: add a line of skip-grant-tables under the [mysqld] segment and restart service mysql restart. Enter mysql. Press enter to skip permission verification and enter.

3. use mysql;

4. update mysql. user set authentication_string = password ('000000') where user = 'root ';

5. update user set plugin = "mysql_native_password ";

6. flush privileges;

7. quit;

8. Go back to step 2, delete the previously added sentence, and restart the service.

9. You can log on with the new password.

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.