2013年10月9日 星期三

XAMPP - 設定MySQL管理帳號密碼

安裝XAMPP後,MySQL預設管理帳號為root,但未加密碼。我們可以透過以下網址變更MySQL管理帳號密碼
http://localhost/security/index.php

變更MySQL root密碼後,必須一併更新PHPMyAdmin的設定檔,否則將無法登入PHPMyAdmin管理頁面。
PHPMyAdmin的設定檔在xampp之phpmyadmin子目錄,檔名config.inc.php

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