52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
  • 伐AI璁函移瘛怠伐
     
亦: 4829|敺: 0
銝銝銝駁 銝銝銝駁

[mysql] 閫瘙 php叮ysql隞孑ysqli_connect()蝑蝑航炊==>mysqlnd cannot connect to MySQL 4.1

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2018-10-11 12:57:07 | 芰閰脖 撣 |摨閬 |梯璅∪
酥hp 5.5隞乩 銝 mysql 5.2 嚗叮ysql隞 mysqli_connect() Y航炊mysqli_connect(): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password').
/ e. H7 A1 [3 Q( Q0 M6 r2 L) G- W% _
+ @2 f# N4 t  I臬歉hp 5.3隞亙撖蝣潭16雿蝺函Ⅳ,啁php 5.3隞亙41雿蝺函Ⅳ,mysql 5.2 隞亙閮凋16蝣,隞交甇斤車航炊.
, F; j5 V" W2 J! O閮箸瑚銝mysql: (php 5.6.38 , mysql 5.1.73). X6 w1 D  z8 V* W- g: W
餃叮ysql 嗅頛詨 :
; P8 y8 b" ^  ?2 r9 K% G! Fmysql> SHOW VARIABLES LIKE 'old_passwords';/ Q5 O, I% x# _5 p1 z+ I8 {. R* C
+------------------+-------+2 E3 ^0 J% i1 m( M% S+ w3 d
| Variable_name | Value |/ U- K- |% h) C0 h* g
+------------------+-------+/ o& N; G% d! n- D6 G) ]
| old_passwords | ON   |1 A& ~! B) @; D7 n  f
+------------------+-------+9 o1 l: h: C; G; V' E& j2 J
1 row in set (0.00 sec)/ k' p5 |* ]4 L: }! K# _# w& B* j# G
0 ]9 Q: \7 k+ a" r! t
old_password  ==> ON  撠梯”蝷 /etc/my.cnf  鋆 old_passwords=1  閮剖16蝣,撠摰閮剔 0 嗅mysqld ==> service mysqld restart
' g/ i: l! F' d1 d- |! t1 Y mysql prompt銝頛詨:
& |; Q- F8 }* h. v  c# ~% rmysql> SET old_passwords=FALSE;  
$ X- N0 }6 F- L" W% J" i瑼X叮ysql.user 瘥撖蝣潮瑕漲:
) I+ [7 y6 i3 d: B5 @- X1 Imysql> SELECT 'User', 'Host', Length('Password') FROM mysql.user;5 A/ f" P0 A  y8 Y+ `  H
憒瘝寞41雿,Length('Password')甈雿閰脤賣160(銵函內瘝閮剖蝣) ! m2 R7 G& r1 ~4 y7 N9 u
  X( u; Z7 b( V5 {* j- J3 q% s
閮剖靘撖蝣:0 A5 g" |* l& `  F9 o% S$ Z
mysql> SET PASSWORD FOR 'root'@'192.168.1.1' = PASSWORD('靘撖蝣');    // 撠敹閬詨靘 撣唾@IP 湔,銝閬寥臭
! Q9 e" w( y9 D& G& @mysql> flush privileges;0 {" _, F- ~7 a  R3 O/ W

$ J; x9 Z* q# g! \  n頛詨 SELECT 'User', 'Host', Length('Password') FROM mysql.user; 瑼X亙蝣澆漲,撠勗舐潛曉寧root 撖蝣潮瑕漲撌脫寧41蝣
7 U2 `( }1 Z' W$ u1 [3 y瘜冽:
4 D& t1 h& @# g( E# n憒撣唾憭芸,臭誑啣憿閮剖蝣,粹閮剖蝣 SET PASSWORD FOR 芷撠亙蝣,銝 old_passwords=0 撠撖蝣潮敶梢
===========================================================================
- ]/ ]9 @$ y4 p) y8 V) B! \鄉ysql蝝 8.0.21,php逅ysql箇2銵errors:0 o$ d0 f$ |  C' l5 r' u
mysqli_real_connect(): Server sent charset (255) unknown to the client. Please, report to the developers
- c- I, y6 t( tmysqli_real_connect(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers# G( }! S+ Y# @
:

+ T0 d! x: K9 @  J% t/ V5 w決ySQL 8.0.21銝哨caching_sha2_password舫隤頨思遢撽霅隞塚銝臭誑敺mysql_native_password隞亙php銝詨捆臭誑蝝php嚗銋臭誑靽格遍ySQL蝵柴 曆犖瘙箏靽格遍ySQL蝵:
: F3 l8 b# U, L3 _1 Lvi /etc/my.cnf  乩:
" o+ _, u. U! P[mysqld]9 h8 _  ?; D* D# a9 U% p) Y$ }

: B  ]5 |0 Q% _" O+ F7 pcharacter-set-server=utf8% S# Z1 F* H6 L% ?
default_authentication_plugin=mysql_native_password/ R! ^+ j  F6 ?

# \0 N1 N3 D  f: D[mysql]
; i# }$ R/ \* R3 p% J) wdefault-character-set=utf8( `" ^; Q8 I* @2 i/ x
5 L0 ^0 ^% o4 \) Q
[client]0 P) [6 v  H& J1 W/ i
default-character-set=utf8
" {& }8 T, t8 g, M; K
% `7 Q# y' B, z$ ^- K$ L嗅mysqld% p7 S. }1 v# k& c) u
service mysqld restart9 _6 w5 T3 b3 l
摰!!( M: ~  m6 t5 ]6 S( d. m. }

% {0 p' Q8 {0 m  B3 q0 Q1 h6 \/ l/ |/ \' d

雿輻券

祉蝛閬

撠蝝詨

砍憛批捆靘餉衣雯頝臬批捆蝝颲行粹嗥蝬脩嚗摰撟湔遛嚗嚗甇脖誑銝嗅啣摰嗆摰撟湧翩鈭箏ㄚ孵舫脣伐銝憿亙祉璇甈橘芣遛18甇 雓蝯脣亦閬賬粹脩芣遛18甇脖芣撟渡雯閬賜雯頝臭嗥批捆鞈閮嚗撱箄降典舫脰蝬脰楝批捆蝝蝯蝜ICRA蝝摰鋆閮剖 (粹蝯行霅 祉蝬脣銝蝝瘛函隢憯啣嚗祉閮剜蝞∠)

QQ|撠暺撅||52AV璈A

GMT+8, 2025-10-21 12:45 , Processed in 0.116682 second(s), 16 queries .

蝯∠.撱

52avtv@gmail.com | QQ:2405733034     since 2015-01

鋆貉憒 敹恍敺 餈銵