为什么无法使用 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。


解决方案

  1. 以管理员身份登录 QTS。
  2. 打开 App Center
  3. 安装 phpMyAdminMariaDB 10
  4. 配置 MariaDB 10 设置。
    1. 打开 MariaDB10。
    2. 转到帐户和数据库
    3. 根密码旁,单击重置
      注意
      重置根密码后,应用程序会重新启动。重置根密码不会导致数据丢失。
  5. 配置 phpMyAdmin 设置。
    1. 通过 SMB 连接以管理员身份连接到 Web 共享文件夹。
    2. 转到 Web\phpMyAdmin\
    3. 使用文本编辑器打开 config.inc.php 文件。
    4. 找到服务器配置部分。
      /**
       * 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. 从文件中删除服务器配置脚本。
    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 5MariaDB 10
    11. 输入用户名和密码。
    12. 单击前往

您现在即可使用 phpMyAdmin 连接到 MariaDB。

这篇文章有帮助吗?

谢谢您,我们已经收到您的意见。

请告诉我们如何改进这篇文章:

如果您想提供其他意见,请于下方输入。

选择规格

      显示更多 隐藏更多
      open menu
      back to top