2015-12-09 54 views
0

我在opensuse13.2中安裝了xampp。它安裝得很整齊。但在訪問http://localhost/phpmyadmin/頁面時出現以下錯誤。我在這裏嘗試了幾個答案,但沒有一個幫助,例如將密碼設置爲「」或「」。嘗試通過'http'而不是'config'進行身份驗證。但沒有人在工作。訪問http:// localhost/phpmyadmin /頁面時拒絕訪問

MySQL說:文檔

無法連接:無效設置。 您的配置中定義的控制用戶連接失敗。 phpMyAdmin嘗試連接到MySQL服務器,並且服務器拒絕了連接。您應該檢查配置中的主機,用戶名和密碼,並確保它們與MySQL服務器管理員提供的信息相對應。

以下是phpmyadmin/config.inc.php文件的內容。

/** 
 
* Servers configuration 
 
*/ 
 
$i = 0; 
 

 
/** 
 
* First server 
 
*/ 
 
$i++; 
 
/* Authentication type */ 
 
$cfg['Servers'][$i]['auth_type'] = 'config'; 
 
$cfg['Servers'][$i]['user'] = 'root'; 
 
$cfg['Servers'][$i]['password'] = 'root'; 
 
/* Server parameters */ 
 
//$cfg['Servers'][$i]['host'] = 'localhost'; 
 
//$cfg['Servers'][$i]['connect_type'] = 'tcp'; 
 
$cfg['Servers'][$i]['compress'] = false; 
 
$cfg['Servers'][$i]['AllowNoPassword'] = true; 
 

 
/** 
 
* phpMyAdmin configuration storage settings. 
 
*/ 
 

 
/* User used to manipulate with storage */ 
 
// $cfg['Servers'][$i]['controlhost'] = ''; 
 
// $cfg['Servers'][$i]['controlport'] = ''; 
 
$cfg['Servers'][$i]['controluser'] = 'root'; 
 
$cfg['Servers'][$i]['controlpass'] = 'root'; 
 

 
/* Storage database and tables */ 
 
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';

回答

1

改變這一行

$cfg['Servers'][$i]['password'] = 'root'; 

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

,並嘗試沒有登錄密碼

並且也改變這一行

$cfg['Servers'][$i]['controluser'] = 'root'; 
$cfg['Servers'][$i]['controlpass'] = 'root'; 

$cfg['Servers'][$i]['controluser'] = ''; 
$cfg['Servers'][$i]['controlpass'] = ''; 

更新:重新修改行之後。你的代碼中有以下這行代碼,它允許用戶無需密碼登錄,即上面的代碼在刪除密碼後有效

$cfg['Servers'][$i]['AllowNoPassword'] = true; 
+1

我改變了你寫的行,但它不工作。 – impossible

+1

謝謝,它的工作。我需要重新啓動。 – impossible

0

我建議嘗試密碼,controlpass設置爲'';,而不是'root';

P.S.發佈迄今爲止嘗試過的內容可能會有幫助。所以我們不會重複可能的解決方案。

P.P.S.我無法發表評論,並增加另一個答案似乎不合適,所以我只是簡單地編輯一個答案。

也許你可以設置端口?標準的是80,但有時候被其他程序(例如Skype)使用。所以你可能想要使用8080.但是你應該把localhost改爲localhost:8080。

P.P.P.S.也許你已經發現,但這裏有一些鏈接,可以提供有用的信息: http://www.prestadocumentation.com/how-to-install-phpmyadmin/ http://wpquestions.com/question/showChrono/id/8374

+0

我試過了,它沒有工作。另外,我得到了「您的配置中定義的控制用戶連接失敗」。錯誤也是如此。好吧,我會更新我所嘗試的。 – impossible