Mysql

phpMyAdmin - 無法連接 - 無效設置 - 自從我添加了 root 密碼 - 被鎖定

  • May 20, 2019

我執行 XAMPP,幾天前我通過 phpmyadmin 設置了 root 密碼的密碼,從那一刻起我就無法訪問 phpMyAdmin

我在此連結上關注了幫助,但那裡的一切似乎都很好(在 config.inc.php 中)。我什至嘗試完全解除安裝 xampp,重新啟動 Windows,然後重新安裝 xampp,但仍然指向 localhost/phpmyadmin 我收到以下錯誤

MySQL said: 
Cannot connect: invalid settings. 
phpMyAdmin tried to connect to the MySQL server, and the server rejected the
connection. You should check the host, username and password in your
configuration and make sure that they correspond to the information given
by the administrator of the MySQL server.

我還嘗試通過mysqld.bat重置root密碼,如mysql網站幫助中給出的,但無濟於事

請幫忙!

編輯 config.inc.php 文件。您可以在“C:\xampp\phpmyadmin\”中找到它並更改~第 21 行:

$cfg['Servers'][$i]['password'] = ''; to $cfg['Servers'][$i]['password']  = 'yourPassHere';

保存並再次訪問 phpmyadmin。這將避免您必須按照 Maxwell 的說明更改密碼。

在我的情況下,問題已經通過將 ‘127.0.0.1’ 更改為 ’localhost’ 解決了!!

/* Bind to the localhost ipv4 address and tcp */
$cfg['Servers'][$i]['host'] = '127.0.0.1';

到 >>>

/* Bind to the localhost ipv4 address and tcp */
$cfg['Servers'][$i]['host'] = 'localhost';

好工作

引用自:https://serverfault.com/questions/54118