新聞中心
本文操作環(huán)境:Windows10系統(tǒng)、php7&&mysql8版、Dell G3電腦。

10年積累的網(wǎng)站設(shè)計、成都網(wǎng)站制作經(jīng)驗,可以快速應(yīng)對客戶對網(wǎng)站的新想法和需求。提供各種問題對應(yīng)的解決方案。讓選擇我們的客戶得到更好、更有力的網(wǎng)絡(luò)服務(wù)。我雖然不認識你,你也不認識我。但先網(wǎng)站制作后付款的網(wǎng)站建設(shè)流程,更有阿合奇免費網(wǎng)站建設(shè)讓你可以放心的選擇與我們合作。
php7連不上mysql8怎么解決?
mysql 8 php 7連接失敗 解決辦法
連接mysql 8 時提示未能授權(quán)連接,錯誤所示:
Warning: mysqli::__construct(): (HY000/1045): Access denied for user ‘root’@‘localhost’ (using password: YES) in C:\DISK\apache\Apache24\htdocs\oop\data\sql.php on line 35
Connect Error (Access denied for user ‘root’@‘localhost’ (using password: YES))
Cmd命令下登錄也會出現(xiàn)ERROR 1045(28000)
網(wǎng)上查找原因,查詢到8版本登錄方式修改為caching_sha2_password ,于是修改數(shù)據(jù)庫中用戶登錄方式設(shè)置如下:
1, 使用mysql工具窗口登錄
2, 輸入 命令:
use mysql select user,host,plugin from user; (查看用戶驗證方式) update user set plugin=‘mysql_native_password’ where User=‘root’; FLUSH PRIVILEGES;
問題1:
cmd 登錄mysql出現(xiàn)
error 2003(HY000):Can not connect to MySQL server on ‘localhost‘ (10061)
步驟:
1.檢查mysql進程是否啟動了,沒啟動,在cmd窗口下,net start mysql進程名。
2.mysql啟動情況下,添加端口信息:mysql -u root -P 端口號 -p
問題2:
Cmd登陸時,出現(xiàn)
error 2007 protocal mismatch the server version =11 the client version = 10
使用mysql community工具,在更新時重新檢查配置,發(fā)現(xiàn)服務(wù)端端口還是修改沒有生效。再看一次配置,原來是修改到客戶端端口。于是修改客戶端端口和服務(wù)端一致。再使用cmd登錄即可。
小結(jié):
1.熟悉mysql配置和原理
2.仔細分析問題現(xiàn)象和問題之間關(guān)聯(lián)
網(wǎng)站名稱:php7連不上mysql8怎么解決
本文路徑:http://m.fisionsoft.com.cn/article/coopphi.html


咨詢
建站咨詢
