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 How to change mysql password under Linux. For more information, please follow other related articles on the PHP Chinese website!