Title: Forgot MySQL password
Source: water in the Pacific Ocean
Time: Tue, 14 Mar 2006 12:59:43 + 0000
Author: water in the Pacific Ocean
Http://blog.ciyi.net/read.php? 936
Content:
If MySQL is running, first:
# Killall-term mysqld // kill the MySQL process
Start MYSQL: Bin/safe_mysqld -- skip-grant-tables &
# Mysqld_safe -- skip-grant-Table // enter MySQL without a password.
Then
# MySQL // enter the MySQL Command
> Use MySQL // MySQL table
> Update user SET Password = PASSWORD ("new_pass") where user = "root"; // The ITALIC part is the password you want.
> Flush privileges; // I don't know. It should be an update type.
Kill MySQL again and start MySql in a normal way.
I won't run it, so I will restart it. It will start automatically after it is started.
Note: many new users do not use password = PASSWORD ("..."), but directly use password = "...", so it is difficult to change the password.
Some things need to be combined with actual conditions, such as paths. I am also looking for old materials, which may be slightly different from you.
Generated by Bo-blog 2.0.1 SP1