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:05778瀏覽

初始密碼為空,使用空密碼登陸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刪除