首先建議大家檢查一下自己是否設置了一系列的安全賬號,進入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] yesXAMPP: 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] yesXAMPP: 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] yesXAMPP: 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] yesXAMPP: Password: ******XAMPP: Password (again): ******XAMPP: Reload ProFTPD…XAMPP: Done.
如果設置完畢之后(最好先重啟lampp服務),還是不能通過賬號和密碼訪問phpmyadmin,那么需要修改一個文件。
打開phpMyAdmin根目錄下的config.inc.php,按照以下行修改就可以了:
立即學習“PHP免費學習筆記(深入)”;
把$cfgServers[$i][‘auth_type’]= ‘config’;修改成:
$cfgServers[$i][‘auth_type’]= ‘cookie’;
保存文件,重新訪問phpmyadmin就可以使用賬號的密碼了。
如下圖所示:
推薦學習:phpmyadmin教程