MySQL database root password forgot to modify the method

Source: Internet
Author: User

1, close the MySQL database you are currently running, either by ending the MySQL process or by directly shutting down the MySQL server

2, close the database, run click to start running, enter cmd into the command Line window, in this command line to enter your database installation path, the general default installation will be in C:Program filesmysqlmysql Server 5.0bin

3, enter mysqld--skip-grant-tables in this path and then return, this command means to start the database from Safe mode

4, as long as the above steps succeed, this CMD window will always have a small cursor appears, and then there is no hint to bounce out, this means that your database has been started, this time to reopen a CMD window, the same access to the MySQL database installation path, and then enter MYSQL-UROOT-P , this command means to use a blank password to log in to MySQL, the success of the words will see a mysql> such a hint, and finally at this prompt input update mysql.user set Password=password (' New password ') where user= ' root ';

, enter the password you want to change in the new password, then turn off all the cmd windows, turn off your server in the first step, and then run your server again in the normal steps, at which point your root password will be changed to the new password you just set.

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.