First with the root account login phpMyAdmin, and then click on the left to enter the MySQL database, at the top of the click "MySQL" into the SQL input interface. Enter the following command:
The code is as follows |
Copy Code |
Update user set Password=password (' 123456 ') where user= ' root ' |
Note that if you modify the root password, the password in our phpMyAdmin configuration file also needs to be modified, otherwise login does not go up oh.
phpMyAdmin modified MySQL database root password succeeded
Then you have to enter the phpMyAdmin under the Libraries directory, modify config.default.php file. Find $cfg[' Servers ' [$i] [' password '] = ',
Amended to
The code is as follows |
Copy Code |
$cfg [' Servers '] [$i] [' password '] = ' 123456′; |
123456 is the password you want.
The new password takes effect when you restart MySQL.
Other ways to modify the root password method, using the command mode
Lost root password
The code is as follows |
Copy Code |
Mysqld_safe--skip-grant-tables& Mysql-u Root MySQL mysql> UPDATE user SET Password=password ("New password") WHERE user= ' root '; mysql> FLUSH privileges; |
Under normal circumstances modify
Edit the user table directly with update
code is as follows |
copy code |
Mysql-u Root mysql> use MySQL; mysql> UPDATE user SET Password = Password (' newpass ') WHERE user = ' root '; Mysql> FLUSH privileges; |