flushprivileges;mysql>quit; modify /opt/lampp/phpmyadmin/config .inc.php found the following code: $cfg['servers'][$"/> flushprivileges;mysql>quit; modify /opt/lampp/phpmyadmin/config .inc.php found the following code: $cfg['servers'][$">

Home>Article>Database> What to do if you forget your mysql password under Linux

What to do if you forget your mysql password under Linux

WBOY
WBOY forward
2023-05-26 10:01:05 695browse

The initial password is empty, use the empty password to log in to mysql and execute the following statement

mysql>use mysql; mysql> update user set password=password("root") where user='root'; mysql> flush privileges; mysql> quit; 修改/opt/lampp/phpmyadmin/config.inc.php

Find the following code:

$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;

Change to:

$cfg['servers'][$i]['auth_type'] = 'config'; $cfg['servers'][$i]['user'] = 'root'; $cfg['servers'][$i]['password'] = 'root'; $cfg['servers'][$i]['extension'] = 'mysql'; $cfg['servers'][$i]['allownopassword'] = true;

The above is the detailed content of What to do if you forget your mysql password under Linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete