mysql tutorial forget root password correct solution
Described is the mysql forget root password correct solution, we all know in the actual operation of the forgotten password
Is a very troublesome thing, the following is the correct solution to this problem is given, hope you are browsing
After the harvest will not be small.
Mysql forgot root password solution:
Under the windows:
Open the command line window, stop the mysql service: net stop mysql
Start mysql, the general installation path to mysql, find mysqld-nt.exe
Come to this directory:
c: program filesmysqlmysql server 5.0bin>
Execute: mysqld-nt --skip-grant-tables
In addition to open a command line window, execute mysql
> use mysql # select database tutorials
1.> update user set passwordpassword = password ("new_pass") where
user = "root";
2.> flush privileges;
3.> exit
Use ctrl + alt + del, find the process mysqld-nt kill it, restart the mysql-nt service, you can
Log in with a new password
mysql forget root password solution: under linux:
If mysql is running, kill first: killall -term mysqld.
Start mysql: bin / safe_mysqld --skip-grant-tables &
You can enter the mysql without a password.
Then that's it
1.> use mysql
2.> update user set passwordpassword = password ("new_pass") where
user = "root";
3.> flush privileges;
Re-kill mysql, use the normal method to start mysql.
If mysql is running, kill first: killall -term mysqld.
Start mysql: bin / safe_mysqld --skip-grant-tables & (Sometimes it will be
mysqld_safe)
You can enter the mysql without a password.
Then is / 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, use the normal method to start mysql.