簡體   English   中英

使用PHPMyAdmin拒絕用戶“root”@“localhost”訪問

[英]Access denied for user 'root'@'localhost' with PHPMyAdmin

當我在PHPMyAdmin中設置root密碼時,我收到此錯誤:

#1045 - Access denied for user 'root'@'localhost' (using password: NO)

我無法打開PHPMyAdmin面板。 我究竟做錯了什么?

編輯您的phpmyadmin config.inc.php文件,如果您有密碼,請在以下代碼中插入密碼前面:

$cfg['Servers'][$i]['verbose'] = 'localhost';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = '**your-root-username**';
$cfg['Servers'][$i]['password'] = '**root-password**';
$cfg['Servers'][$i]['AllowNoPassword'] = true;

以下是必須仔細遵循的幾個步驟

  1. 首先確保WAMP服務器在運行時運行,啟動服務器。
  2. 在瀏覽器的地址欄中輸入URL http:// localhost / phpmyadmin / setup
  3. 在C:\\ wamp \\ apps \\ phpmyadmin中創建一個名為config的文件夾,應用程序內的文件夾可能有不同的名稱,如phpmyadmin3.2.0.1

  4. 在phpmyadmin設置選項卡中返回瀏覽器,然后單擊“新建服務器”。 新服務器

  5. 將身份驗證類型更改為“cookie”並將用戶名和密碼字段保留為空,但如果將身份驗證類型更改為“config”,請輸入用戶名root的密碼。

  6. 點擊保存 保存

  7. 再次單擊配置文件選項中的保存。
  8. 現在導航到config文件夾。 在文件夾中,將有一個名為config.inc.php的文件。 復制文件並將其粘貼到文件夾中(如果已存在同名文件,則覆蓋它),最后刪除該文件夾。
  9. 現在你完成了。 嘗試再次連接mysql服務器,這次你不會收到任何錯誤。 --credits Bibek Subedi

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM