2012-11-11 190 views
0

我得到一個錯誤,當我嘗試登錄到myphpadmin ...phpMyAdmin的本地主機的錯誤(XAMPP)

#1045 Cannot log in to the MySQL server 
Connection for controluser as defined in your configuration failed. 

是有什麼錯我的配置文件?

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

/* 
* First server 
*/ 
$i++; 
/* Authentication type */ 
$cfg['Servers'][$i]['auth_type'] = 'cookie'; 
/* Server parameters */ 
$cfg['Servers'][$i]['host'] = 'localhost'; 
$cfg['Servers'][$i]['connect_type'] = 'tcp'; 
$cfg['Servers'][$i]['compress'] = false; 
/* Select mysql if your server does not have mysqli */ 
$cfg['Servers'][$i]['extension'] = 'mysqli'; 
$cfg['Servers'][$i]['AllowNoPassword'] = false; 

/* 
* phpMyAdmin configuration storage settings. 
*/ 

/* User used to manipulate with storage */ 
$cfg['Servers'][$i]['controlhost'] = ''; 
$cfg['Servers'][$i]['controluser'] = '<username here>'; 
$cfg['Servers'][$i]['controlpass'] = '<password here>'; 

/* Storage database and tables */ 
// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; 
// $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark'; 
// $cfg['Servers'][$i]['relation'] = 'pma_relation'; 
// $cfg['Servers'][$i]['table_info'] = 'pma_table_info'; 
// $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords'; 
// $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages'; 
// $cfg['Servers'][$i]['column_info'] = 'pma_column_info'; 
// $cfg['Servers'][$i]['history'] = 'pma_history'; 
// $cfg['Servers'][$i]['table_uiprefs'] = 'pma_table_uiprefs'; 
// $cfg['Servers'][$i]['tracking'] = 'pma_tracking'; 
// $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords'; 
// $cfg['Servers'][$i]['userconfig'] = 'pma_userconfig'; 
// $cfg['Servers'][$i]['recent'] = 'pma_recent'; 
/* Contrib/Swekey authentication */ 
// $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf'; 

/* 
* End of servers configuration 
*/ 

我不由得注意到,很多這是犯了....應該是?

我真的不知道我在做什麼...任何幫助將是驚人的!

回答

1
$cfg['Servers'][$i]['controluser'] = '<username here>'; 
$cfg['Servers'][$i]['controlpass'] = '<password here>'; 

這兩行起碼需要進行配置,如果你只是做了一個基本安裝要麼他們都是空白或用戶名是root,密碼爲空。如果您分配了用戶名和密碼,他們將進入這些字段,並且由於您允許沒有密碼設置爲false,所以您需要使用用戶名和密碼設置數據庫或將該值設置爲true。在本地測試時沒有密碼是正確的,但不是當您將其上傳到您的實時服務器時。

-1

刪除所有相關的cookies後關閉它,然後如果不工作檢查你的php ini配置文件,看看用戶是否已被改變。

+0

刪除我的瀏覽器上的所有cookie? – user1269625

+0

這是不會做任何事情的,因爲根據我的回答,原因是你的錯誤用戶名和密碼傳遞給數據庫。這應該是由它返回的錯誤顯而易見的。 –

0

如果有幫助,這是我的config.inc.php文件是什麼樣子:

<?php 
/* 
* This is needed for cookie based authentication to encrypt password in 
* cookie 
*/ 
$cfg['blowfish_secret'] = 'xampp'; /* YOU SHOULD CHANGE THIS FOR A MORE SECURE COOKIE AUTH! */ 

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

/* 
* First server 
*/ 
$i++; 

/* Authentication type and info */ 
$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; 

/* User for advanced features */ 
$cfg['Servers'][$i]['controluser'] = 'pma'; 
$cfg['Servers'][$i]['controlpass'] = ''; 

/* Advanced phpMyAdmin features */ 
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; 
$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark'; 
$cfg['Servers'][$i]['relation'] = 'pma_relation'; 
$cfg['Servers'][$i]['table_info'] = 'pma_table_info'; 
$cfg['Servers'][$i]['table_coords'] = 'pma_table_coords'; 
$cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages'; 
$cfg['Servers'][$i]['column_info'] = 'pma_column_info'; 
$cfg['Servers'][$i]['history'] = 'pma_history'; 
$cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords'; 
$cfg['Servers'][$i]['tracking'] = 'pma_tracking'; 
$cfg['Servers'][$i]['userconfig'] = 'pma_userconfig'; 

/* 
* End of servers configuration 
*/ 

?> 

如果我進入phpMyAdmin的,然後單擊權限選項卡我也有以下用戶:

User Host Password Global privileges Grant 
Any  %   --  USAGE    No 
Any  localhost No  USAGE    No 
pma  localhost No  USAGE    No 
root 127.0.0.1 No  ALL PRIVILEGES  Yes 
root localhost No  ALL PRIVILEGES  Yes 
+0

它幫助,但現在我得到這個錯誤,當我登錄到phpmyadmin'phpMyAdmin配置存儲沒有完全配置,一些擴展功能已被停用.'和我無法創建一個數據庫(無特權)它說 – user1269625

+0

我添加到我的文章包括他們在phpMyAdmin中的用戶和權限。我希望這有幫助。 – Boundless