以 PHP 撰寫的 Web 介面 MySQL 管理工具,透過瀏覽器即可操作資料庫、資料表、SQL 查詢、匯入匯出、權限管理等,無需 Shell 登入伺服器。
phpMyAdmin_2.0.5.tar.gz (需自行中文化) 或 c_phpMyAdmin_2.0.5.tar.gz (內建中文優化)。mv phpMyAdmin_2.0.5.tar.gz /usr/local/apache/htdocs/
tar zxvf phpMyAdmin_2.0.5.tar.gz
# 產生 /usr/local/apache/htdocs/phpMyAdmin/
config.inc.php3:
$cfgServers[1]['host'] = 'localhost';
$cfgServers[1]['port'] = ''; // 預設 3306
$cfgServers[1]['adv_auth'] = true; // 啟用進階認證
$cfgServers[1]['stduser'] = 'root'; // 管理帳號
$cfgServers[1]['stdpass'] = '123456'; // 管理密碼
https://yourhost/phpMyAdmin/ 即可登入。chinese_big5.inc.php3。mv chinese_big5.inc.php3 chinese_big5.inc.php3.old。預設路徑 /phpMyAdmin 易遭掃描攻擊。重命名目錄即可:
cd /usr/local/apache/htdocs/
mv phpMyAdmin pma # 或任意難猜名稱
之後以 https://yourhost/pma/ 存取,僅知情者可用。
$cfgServers[1]['auth_type'] = 'cookie' 使用 Cookie 認證,避免明文密碼寫在設定檔。<Directory> 加入 Allow from 192.168.1.0/24。