系統:Windows
錯誤如下:
查閱了一些資料,有些說的方法如下:
Step1:將F:\xampp\phpMyAdmin\libraries的config.default.php中的一下字段修改。
Step1:$cfg['Servers'][$i]['password'] = ''; //將此字段修改爲空
Step2:$cfg['Servers'][$i]['nopassword'] = true;//將此字段修改爲true
Step3:$cfg['Servers'][$i]['AllowNoPassword'] = true;//將此字段修改爲true
Step4:root用戶使用空密碼即可登錄,記得修改root用戶的密碼。
但是修改之後我還是不能登錄。另一種方法如下:
Step1:使用另一個超級用戶的賬號密碼登錄phpMyAdmin
Step2:
Step3:選擇修改密碼
Step4:填入密碼以及重新輸入,點擊執行即可。不要點擊生成密碼!!!
Step5:修改成功之後會顯示如下信息:
Step 6:root用戶需要有一個Host爲localhost的用戶。(不知道爲什麼我用phpMyAdmin創建用戶失敗)
在PHPMyAdmin中新建用戶:grant all privileges on *.* to 'root'@'localhost' identified by "newpassword" with grant option;
Step7:將F:\xampp\phpMyAdmin\libraries\config.default.php中的
$cfg['Servers'][$i]['password'] = '';
修改爲:
$cfg['Servers'][$i]['password'] = 'newpassword';
其中newpassword爲root用戶的密碼。重啓Apache和mysqld.exe,使用新的賬號密碼登錄phpMyAdmin即可。