为什么无法使用 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 不是内置应用程序,因此,您必须在 Windows 上通过 SMB 编辑 phpMyAdmin 配置文件 (config.inc.php) 才能访问 MariaDB 10。
解决方案
- 以管理员身份登录 QTS。
- 打开 App Center。
- 安装 phpMyAdmin 和 MariaDB 10。
- 配置 MariaDB 10 设置。
- 打开 MariaDB10。
- 转到帐户和数据库。
- 在根密码旁,单击重置。注意重置根密码后,应用程序会重新启动。重置根密码不会导致数据丢失。
- 配置 phpMyAdmin 设置。
- 通过 SMB 连接以管理员身份连接到 Web 共享文件夹。
- 转到 Web\phpMyAdmin\。
- 使用文本编辑器打开 config.inc.php 文件。
- 找到服务器配置部分。
/** * 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; - 从文件中删除服务器配置脚本。
- 输入以下脚本。
/** * 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; - 保存文件。
- 关闭 phpMyAdmin 应用程序。
- 重新打开 phpMyAdmin 应用程序。
- 选择 MariaDB 5 或 MariaDB 10。

- 输入用户名和密码。
- 单击前往。
您现在即可使用 phpMyAdmin 连接到 MariaDB。