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

首页 >数据库 >mysql教程 >Linux下忘记mysql密码怎么办

Linux下忘记mysql密码怎么办

WBOY
WBOY转载
2023-05-26 10:01:05779浏览

初始密码为空,使用空密码登陆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删除