
版本/程式:
xenforo 1.2.9, phpmyadmin 4.x, php 5.6.4, MySQL 8.0.32 IIS 10, Windows Server 2019
我正在嘗試託管一個本地伺服器,以便在我擁有的舊電腦上進行修補。該伺服器將託管 XenForo 安裝。然而,我的xenforo是1.2.9,它已經過時了,需要php5.6.4。因為我使用舊的 php 版本,所以我還需要 phpmyadmin 4.x。
我已經安裝了所有這些。我知道使用最新的軟體會更容易包括 xenforo,但我在 2013 年購買了這個許可證,並且想在花錢之前對其進行修改。我想免費設定它,然後決定是否要升級所有內容。當我看到“開始安裝”時,Xenforo 目錄工作正常,但在訪問資料庫之前無法開始。
我的問題是,當我訪問本機/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 來幫助解決此錯誤,但我陷入了死胡同。它說將以下程式碼添加到配置.ini.php文件:
$cfg['blowfish_secret'] = 'S&#QX3LqK6sMtp$PWV?lLfJv0<u4moPe'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
//$cfg['blowfish_secret'] = ')6U}lm)*ZRK|Q82zae=Lv\^FbVVIWp{m';
/**
* 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'] = 'xenforo';
//$cfg['Servers'][$i]['user'] = 'root';
//$cfg['Servers'][$i]['password'] = '{mypass}';
我想知道這是否是我的 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 還說將以下程式碼新增至 php 檔案 [連接到 mysql 資料庫] 但我不確定在哪裡添加它:
<?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');
請有人幫忙。我完全迷路了。如果您需要更多信息,請告訴我,我將編輯這個問題。
我努力了:
- 禁用河豚並嘗試使用conf檔案取代(錯誤)
- mysql_connect(): 伺服器請求客戶端未知的驗證方法 [mysql_old_password]