我已經(jīng)安裝了MySQL 8.0服務(wù)器和phpMyAdmin,但是當(dāng)我嘗試從瀏覽器訪問它時(shí),會(huì)發(fā)生以下錯(cuò)誤:#2054 - The server requested authentication method unknown to the clientmysqli_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我想它一定與實(shí)現(xiàn)的強(qiáng)密碼和MySQL版本的相對(duì)更新有關(guān)。但是我對(duì)最高級(jí)的驅(qū)動(dòng)程序和連接配置一無所知。有人遇到過同樣的問題并解決了嗎?:D編輯使用apt安裝apt-get install mysql-server phpmyadmin
3 回答

呼如林
TA貢獻(xiàn)1798條經(jīng)驗(yàn) 獲得超3個(gè)贊
我通過以下操作解決了這個(gè)問題:
添加
default_authentication_plugin = mysql_native_password
到
my.cnf 的[mysqld]部分輸入mysql并通過執(zhí)行類似操作來創(chuàng)建新用戶
CREATE USER 'root'@'localhost' IDENTIFIED BY 'password';
根據(jù)需要授予特權(quán)。例如
GRANT ALL PRIVILEGES ON * . * TO 'root'@'localhost';
,然后FLUSH PRIVILEGES;
用新用戶登錄phpmyadmin
添加回答
舉報(bào)
0/150
提交
取消