flushprivileges;mysql>quit;修改/opt/lampp/phpmyadmin/config.inc.php找到如下代码:$cfg['servers'][$"/> flushprivileges;mysql>quit;修改/opt/lampp/phpmyadmin/config.inc.php找到如下代码:$cfg['servers'][$">

首页  >  文章  >  运维  >  Linux下如何修改mysql密码

Linux下如何修改mysql密码

WBOY
WBOY转载
2023-05-18 17:22:06935浏览

初始密码为空,使用空密码登陆mysql执行下列语句

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

找到如下代码:

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

修改为:

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

以上是Linux下如何修改mysql密码的详细内容。更多信息请关注PHP中文网其他相关文章!

声明:
本文转载于:yisu.com。如有侵权,请联系admin@php.cn删除