Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> 電腦軟體教學 >> 伺服器技術 >> 關於伺服器

phpMyAdmin 允許空密碼登入配置方法

編輯:關於伺服器

適用場景

本地開發測試環境為方便操作,需允許 MySQL root 空密碼登入 phpMyAdmin。生產環境嚴禁啟用!

修改配置檔

  1. 尋找配置檔:
    優先 config.inc.php (根目錄) → 次選 libraries/config.default.php (版本差異)。
  2. 搜尋 \$cfg['Servers'][\$i]['AllowNoPassword']。
  3. 將 false 改為 true:
\$cfg['Servers'][\$i]['AllowNoPassword'] = true;

配合 MySQL 設定空密碼

若 MySQL 本身已設密碼,仍需輸入。真正免密需將 MySQL root 密碼設為空:

mysql -u root -p
# 輸入當前密碼進入
UPDATE mysql.user SET authentication_string=PASSWORD('') WHERE User='root';
FLUSH PRIVILEGES;

再次提醒: 僅限本地/內網測試環境,公開網路環境務必設定強密碼。

Copyright © Windows教程網 All Rights Reserved