You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows Server 2019(IIS 10)环境下配置XenForo 1.2.9时,PHPMyAdmin 4.x连接MySQL 8.0.32出现认证方法未知错误的解决求助

Windows Server 2019(IIS 10)环境下配置XenForo 1.2.9时,PHPMyAdmin 4.x连接MySQL 8.0.32出现认证方法未知错误的解决求助

当前环境配置

  • XenForo 1.2.9
  • PHPMyAdmin 4.x
  • PHP 5.6.4
  • MySQL 8.0.32
  • IIS 10
  • Windows Server 2019

问题背景

我打算在旧电脑上搭个本地服务器折腾一下,主要用来跑XenForo。这个XenForo是2013年买的1.2.9旧版本,必须搭配PHP 5.6.4才能用;而老版本PHP对应的PHPMyAdmin也只能用4.x。现在这些软件都装好了,我知道用新版软件会省事很多,但想先免费折腾完这个旧版本,再决定要不要花钱升级。

目前XenForo的目录能正常访问,能看到“开始安装”的界面,但必须先连上数据库才能继续安装流程。

遇到的具体问题

访问localhost/phpmyadmin/index.php能正常看到登录界面,但输入确认正确的账号密码后,直接弹出以下错误:

mysqli_real_connect(): The server requested authentication method unknown to the client [caching_sha2_password]
mysqli_real_connect(): (HY000/2054): The server requested authentication method unknown to the client

已尝试的解决操作

我找ChatGPT帮忙排查,但现在彻底卡住了。它让我修改PHPMyAdmin的config.ini.php文件,修改后的内容如下:

/**
* This is needed for cookie based authentication to encrypt password in
* cookie. Needs to be 32 chars long.
*/
$cfg['blowfish_secret'] = 'S&#QX3LqK6sMtp$PWV?;.fJv0<u4mo[e'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

/**
* Servers configuration
*/
$i = 0;

/**
* First server
*/
$i++;

/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
//$cfg['Servers'][$i]['auth_type'] = 'config';

/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;
//$cfg['Servers'][$i]['user'] = 'root';
//$cfg['Servers'][$i]['password'] = '{mypassword}';

另外ChatGPT还让我在连接MySQL的PHP文件里加一段代码,但我完全不知道该把这段代码加在哪个文件里:

<?php

// Database configuration
define('DB_HOST', 'localhost');
define('DB_USER', 'user');
define('DB_PASS', 'password');
define('DB_NAME', 'database');

// Create a database connection
$link = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);

// Set the character set
mysqli_set_charset($link, 'utf8');

除此之外,我还试过:

  • 禁用blowfish设置,改用config认证方式,但还是报错,错误信息变成:mysql_connect(): The server requested authentication method unknown to the client [mysql_old_password]

现在我完全摸不着头绪了,有没有大佬能帮我解决这个问题?如果需要更多环境细节或者操作日志,我随时可以补充。

备注:内容来源于stack exchange,提问作者Fictor

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.23 12:17:59