首先建議大家檢查一下自己是否設定了一系列的安全帳號,進入linux系統的指令終端,輸入:sudo /opt/lampp/lampp security
#然後就會出現一些欄位的帳號設置,大家一路設定下去就行,整體設定如下所示:
XAMPP: Quick security check...
XAMPP: Your XAMPP pages are NOT secured by a password.
XAMPP: Do you want to set a password? [yes] yes (1)
XAMPP: Password: ******
#XAMPP: Password (again): ******
XAMPP: Password protection active. Please use 'lampp' as user name!
XAMPP: MySQL is accessable via network.
XAMPP: Normaly that's not recommended. Do you want me to turn it off? [yes] yes
XAMPP: Turned off.
XAMPP: Stopping MySQL...
XAMPP: Starting MySQL...
XAMPP: The MySQL/phpMyAdmin user pma has no password set!!!
XAMPP: Do you want to set a password? [yes] yes
XAMPP: Password: ******
XAMPP: Password (again): ******
XAMPP: Setting new MySQL pma password.
XAMPP: Setting phpMyAdmin's pma password to the new one.
XAMPP: MySQL has no root passwort set!!!
#XAMPP: Do you want to set a password? [yes] yes
XAMPP: Write the passworde somewhere down to make sure you won't forget it!!!
#XAMPP: Password: ******
XAMPP: Password (again): ******
XAMPP: Setting new MySQL root password.
XAMPP: Setting phpMyAdmin's root password to the new one.
XAMPP: The FTP password for user 'nobody' is still set to 'lampp'.
XAMPP: Do you want to change the password? [yes] yes
#XAMPP: Password: ******
XAMPP: Password (again): ******
XAMPP: Reload ProFTPD...
XAMPP: Done.
如果設定完畢之後(最好先重啟lampp服務),還是無法透過帳號和密碼存取phpmyadmin,那麼就需要修改一個檔案。
開啟phpMyAdmin根目錄下的config.inc.php,依照下列列修改就可以了:
把$cfgServers[$i]['auth_type']= 'config';修改成:
$cfgServers[$i]['auth_type']= 'cookie';
儲存文件,重新造訪phpmyadmin就可以使用帳號的密碼了。
如下圖所示:
#推薦學習:phpmyadmin教學
#以上是如何進行加密存取phpmyadmin的詳細內容。更多資訊請關注PHP中文網其他相關文章!