MySQL forgot root password correct solution

Source: Internet
Author: User
Tags flush mysql tutorial

MySQL tutorial forget root password correct solution

Describes the MySQL forgot root password correct solution, we all know in the actual operation forgot the password

is a very troubling thing, the following is the correct solution to this problem, I hope you are browsing the

Will reap a little.

MySQL forgot root password solution:

Under Windows:

Open a command line window to stop the MySQL service: net stop MySQL

Start MySQL, general to the installation path of MySQL, find Mysqld-nt.exe

Come to this directory:

C:Program Filesmysqlmysql Server 5.0bin>

Executive: Mysqld-nt--skip-grant-tables

In addition, open a command line window to execute MySQL

>use MySQL #选择数据库教程

1.>update User Set Passwordpassword=password ("New_pass") where

User= "Root";

2.>flush privileges;

3.>exit

With Ctrl+alt+del, find the mysqld-nt process kill it, restart the Mysql-nt service, you can

To log in with the new password.

MySQL Forget root password solution: under Linux:

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

1.>use MySQL

2.>update User Set Passwordpassword=password ("New_pass") where

User= "Root";

3.>flush privileges;

Re-kill MySQL, the normal way to start MySQL.

If MySQL is running, first kill: Killall-term mysqld.

Start Mysql:bin/safe_mysqld--skip-grant-tables & (sometimes it will be

Mysqld_safe)

You can enter MySQL without the need for a password.

And then there's/usr/local/mysql/bin/mysql.

1.>use MySQL

2.>update User Set Passwordpassword=password ("New_pass") where

User= "Root";

3.>flush privileges;

Re-kill MySQL, the normal way to start MySQL.

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.