in known MYSQL of the database ROOT user Password, the method of changing the password:
1. in the SHELL Environment, use the mysqladmin command settings:mysqladmin–u root–p Password " new password " enter after the old password is required
2. in the mysql> Environment , update MySQL directly with the update command data for the library user table:
Update Mysql.user Set Password=password (' new password ') where user= ' root ';
Flush privileges;
Note: MySQL statement to use a semicolon " ; " End
3. in the mysql> Environment, use the grant command to modify the root The user's authorization rights.
Grant All on * * to [e-mail protected] ' localhost ' identified by ' New Password ' ;
if you forget. MySQL of the database ROOT user's password, and how to do it? Here's how:
1. Close the currently running mysqld Service Program:servicemysqld stop(to first mysqld Add as System service)
2. Use the mysqld_safe script to start the MYSQLD service in Safe mode (without loading the authorization table)
/usr/local/mysql/bin/mysqld_safe--skip-grant-table &
3. Log in to the database with a root user with a blank password and reset the root user's password
# mysql-u Root
mysql> Update Mysql.user set Password=password (' new password ') where user= ' root ';
mysql> flush Privileges;
This article from "Liu Xiao Rabbit" blog, reproduced please contact the author!
Reset the password of the MySQL database root user