MySQL Recover admin password

Source: Internet
Author: User

Method One:

1. Stop MySQL Services: Service mysqld stop

2. Start the MySQL service via Mysqld_safe and pass two parameters at the same time:

--skip-grant-tables--skip-networking

namely: Mysqld_safe--skip-grant-tables--skip-networking &

3, the empty password to connect to MySQL, namely: mysql-uroot-p

4, change the root password,

That is: Update mysql.user set Password=password (' New_password ') where condition;

5, restart the MYSL service, normal connection can be.

Method Two:

1. Stop MySQL Services: Service mysqld stop

2, VIM/ETC/MY.CNF

Added under [mysqld]: Skip-grant-tables

Skip-networking

3, save exit, empty password connection MySQL

4. Change the root password

5, edit my.cnf, remove the contents of Step 2 added, save the exit, restart the MySQL service.




This article is from "Walking in the growth, drip records ..." Blog, be sure to keep this source http://poseidon2011.blog.51cto.com/7553825/1863008

MySQL Recover admin password

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.