The best test of the Mysql password forgotten solution _mysql

Source: Internet
Author: User
Tags flush
The best use of the MySQL password to forget the solution, after testing, if not successful general is your MySQL run abnormal
Solution:
Under Windows:
Copy Code code as follows:

Open the Command Line window to stop the MySQL service:
Net stop MySQL
Start MySQL, general to the installation path of MySQL, find Mysqld-nt.exe
Execution: mysqld-nt--skip-grant-tables The current window will stop.
Also open a command line window, execute MySQL If prompted without this command, first go to MySQL installation location under the Bin directory and then run MySQL
>use MySQL
>update User Set Password=password ("New_password") where user= "root";
>flush privileges;
>exit
With Ctrl+alt+del, find the mysqld-nt process kill it, restart the Mysql-nt service, you can log in with the new password


under Linux:
Copy Code code as follows:

If MySQL is running, first kill: Killall-term mysqld.
Start Mysql:bin/safe_mysqld--skip-grant-tables &
You can enter MySQL without the need for a password.
Then it's
>use MySQL
>update User Set Password=password ("New_pass") where user= "root";
>flush privileges;
Re-kill MySQL, start in normal way
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.