How to modify the MySQL administrator password

Source: Internet
Author: User

How to modify the MySQL administrator password

1. Turn off mysql first

Service mysqld stop

2. Manual start

Two methods

A: service mysqld start -- skip-grant-tables -- skip-name-resolve start

B: edit/etc/init. d/mysqld file. Add the -- skip-grant-tables -- skip-name-resolve statement to the line, but remove the added content after the modification.

3. Run mysql

Run the command line to directly enter mysql

4. Change the password

Use mysql;

Here only this method is allowed to change the password update user set password = password ('000000') where user = 'root ';

123456789 is the password I set.

5. Disable mysql

Service mysql stop

6. Restart mysql

Note that you can directly Restart Method A in step 2. If Method B is used, you must delete the added content and restart it.

Service mysqld start

This article permanently updates the link address:

Related Article

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.