2011-02-19 111 views
0

我正在使用rhel 5和php 5與MySQL 5.我的服務器已經配置並且順利運行所有應用程序。我以root身份訪問mysql,密碼是'anitha123'。但是當我通過瀏覽器訪問phpmyadmin時,它並不要求輸入密碼。有人請告訴我如何設置它像提示輸入用戶名和密碼。由於我不熟悉php mysql,請告訴我如何以簡單的方式來完成。爲phpMyAdmin設置密碼

+1

有關管理服務器的幫助,您應該考慮在http://serverfault.com上發佈您的問題 - Stack Overflow用於編程問題。 – Sampson 2011-02-19 04:55:08

回答

6

發現phpmyadmin.conf 並設置身份驗證鍵入到http

/* Authentication type */ 
$cfg['Servers'][$i]['auth_type'] = 'http'; 
1

或者乾脆你可以添加密碼進入phpmyadmin的的配置文件。此 找到config.inc.php文件是在phpMyAdmin目錄,然後做出這些改變

找到行 $ CFG樁[ '服務器'] [$ i] [ '密碼'] = '';

然後在布蘭克字段中添加您的密碼

$ CFG樁[ '服務器'] [$ i] [ '密碼'] = 'anitha123';

,它總是使用相同的用戶名和密碼打開

0

進入phpMyAdmin的,並確保你有3根用戶mysql的順利使用。如果您在密碼欄中看到「否」,請點擊Edit Privileges---> Change Password選擇Password選項並設置您的密碼(三者必須設置爲Password Yes)。雖然這樣做不會刷新你的瀏覽器其他明智的你會得到一個錯誤

xampp mysql Access denied for user 'root'@'localhost' using password: YES 

你的用戶屏幕必須是這樣的。

User name Host  Password   Global privileges 
root  127.0.0.1   Yes  ALL PRIVILEGES  Yes  
root  ::1    Yes  ALL PRIVILEGES  Yes  
root  localhost   Yes  ALL PRIVILEGES  Yes 

當完成這個。只需使用此設置 - >在phpmyadmin目錄中打開config.inc.php文件

/* Authentication type and info */ 
$cfg['Servers'][$i]['auth_type'] = 'cookie'; 
$cfg['Servers'][$i]['user'] = 'root'; 
$cfg['Servers'][$i]['password'] = ''; 
$cfg['Servers'][$i]['extension'] = 'mysqli'; 
$cfg['Servers'][$i]['AllowNoPassword'] = true; 
$cfg['Lang'] = ''; 

現在打開phpmyadmin。 phpmyadmin會要求您輸入密碼。如果您提供了正確的密碼,您將能夠登錄。