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  >  Operation and Maintenance  >  How to change mysql password under Linux

How to change mysql password under Linux

WBOY
WBOYforward
2023-05-18 17:22:06937browse

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!

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