I have referred to some methods provided on the Internet and found that they are quite complicated. We will share with you a simple and quick method.
First, the mysql user information is saved in the user table of the mysql database, and the Password field of the table is encrypted and stored using the PASSWORD method.
Once you understand the preceding prompts, you can simply change the password and run the following SQL statement (change the password to jb51.net here ):
Copy codeThe Code is as follows:
UPDATE user SET password = PASSWORD ('jb51. net') WHERE user = 'root ';
After the above operations, the password is changed.
If you want to directly enter localhost/phpMyadmin and go to the phpMyadmin management interface without entering the user name and password, perform the following operations:
Find the phpMyadmin configuration file, that is, config. inc. php under the phpMyAdmin directory, and find the following code:
Copy codeThe Code is as follows:
/* Authentication type and info */
$ Cfg ['servers'] [$ I] ['auth _ type'] = 'config ';
$ Cfg ['servers'] [$ I] ['user'] = 'root ';
$ Cfg ['servers'] [$ I] ['Password'] = '';
$ Cfg ['servers'] [$ I] ['extension'] = 'mysql ';
$ Cfg ['servers'] [$ I] ['allownopassword'] = true;
Copy codeThe Code is as follows:
/* Authentication type and info */
$ Cfg ['servers'] [$ I] ['auth _ type'] = 'config ';
$ Cfg ['servers'] [$ I] ['user'] = 'root ';
$ Cfg ['servers'] [$ I] ['Password'] = 'jb51. net ';
$ Cfg ['servers'] [$ I] ['extension'] = 'mysql ';
$ Cfg ['servers'] [$ I] ['allownopassword'] = true;