為何無法利用 phpMyAdmin 連線到 MariaDB?


最後修訂日期: 2023-07-28

適用產品

  • MariaDB 10
  • 安裝於 QTS 5.0.x 的 phpMyAdmin 4.9.11.0 (含) 之前版本
  • 安裝於 QTS 5.1.x 的 phpMyAdmin 5.2.1.0 (含) 之前版本

根本原因

MariaDB 10 非內建應用程式。因此,您必須透過 SMB 在 Windows 編輯 phpMyAdmin 設定檔 (config.inc.php),才能存取 MariaDB 10。


解決方案

  1. 以管理員身分登入 QTS。
  2. 開啟[App Center]
  3. 安裝[phpMyAdmin][MariaDB 10]
  4. 編輯 MariaDB 10 設定。
    1. 開啟[MariaDB10]。
    2. 前往[帳戶與資料庫]
    3. 按一下[根密碼]旁邊的[重設]
      備註
      重設根密碼後,應用程式將重新啟動。重設根密碼不會讓資料遺失。
  5. 編輯 phpMyAdmin 設定。
    1. 以系統管理員身分,透過 SMB 連線至[Web]共用資料夾。
    2. 前往[Web\phpMyAdmin\]
    3. 透過文字編輯器開啟 config.inc.php 檔案。
    4. 找到[Servers configuration]區段。
      /** * Servers configuration */ $i = 0; /** * First server */ $i++; /* Authentication type */ $cfg['Servers'][$i]['auth_type'] = 'cookie'; /* Server parameters */ $cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['compress'] = false; $cfg['Servers'][$i]['AllowNoPassword'] = false;
    5. 刪除檔案中[Servers configuration]的指令碼。
    6. 輸入下列指令碼。
      /** * Servers configuration */ $i = 0; /** * First server */ $i++; /* Authentication type */ $cfg['Servers'][$i]['verbose'] = 'MariaDB 5'; $cfg['Servers'][$i]['auth_type'] = 'cookie'; /* Server parameters */ $cfg['Servers'][$i]['socket'] = '/tmp/mysql.sock'; $cfg['Servers'][$i]['compress'] = false; $cfg['Servers'][$i]['AllowNoPassword'] = false; /** * Second server */ $i++; /* Authentication type */ $cfg['Servers'][$i]['verbose'] = 'MariaDB 10'; $cfg['Servers'][$i]['auth_type'] = 'cookie'; /* Server parameters */ $cfg['Servers'][$i]['socket'] = '/var/run/mariadb10.sock'; $cfg['Servers'][$i]['compress'] = false; $cfg['Servers'][$i]['AllowNoPassword'] = false;
    7. 儲存檔案。
    8. 關閉[phpMyAdmin]應用程式。
    9. 重新開啟[phpMyAdmin]應用程式。
    10. 選擇[MariaDB 5][MariaDB 10]
    11. 輸入使用者名稱和密碼。
    12. 按一下[Go (前往)]

現在您已可透過 phpMyAdmin 連線至 MariaDB。

這篇文章有幫助嗎?

58% 的人認為有幫助。
謝謝您,我們已經收到您的意見。

請告訴我們如何改進這篇文章:

如果您想提供其他意見,請於下方輸入。

選擇規格

      顯示更多 隱藏更多

      選擇其他偏好的語言:

      back to top