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.