phpMyAdmin 預設無密碼即可登入,極度危險。修改 config.inc.php 啟用 Cookie 認證,強制輸入 MySQL 帳密才能進入。
config.inc.php。$cfg['Servers'][$i]['auth_type'],修改為:$cfg['Servers'][$i]['auth_type'] = 'cookie';
| 模式 | 說明 | 適用環境 |
|---|---|---|
| config | 直接讀取設定檔帳密,無登入畫面 | 僅本機開發 |
| http | HTTP Basic Auth 彈窗登入 | Apache + mod_php |
| cookie | 表單登入,Cookie 保存會話 | 通用(含 IIS、PHP-FPM) |
http 模式無效,必須用 cookie。$cfg['blowfish_secret'] 為長隨機字串,用於 Cookie 加密。