52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
  • 伐AI璁函移瘛怠伐
     
亦: 4974|敺: 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').
" w) z9 |, X- i6 W# Y4 `1 X- h$ L" p5 o  E5 H: w( R0 E
臬歉hp 5.3隞亙撖蝣潭16雿蝺函Ⅳ,啁php 5.3隞亙41雿蝺函Ⅳ,mysql 5.2 隞亙閮凋16蝣,隞交甇斤車航炊.+ Q* ]& D( M$ l$ ^- ~) e! ]0 b! ]
閮箸瑚銝mysql: (php 5.6.38 , mysql 5.1.73)7 q7 Z2 E; ], q+ x4 j+ q0 \# U7 ^
餃叮ysql 嗅頛詨 :
; V! D$ d+ T  I- M6 I2 k9 b* g6 f1 gmysql> SHOW VARIABLES LIKE 'old_passwords';, I" J& I+ k$ Q- w; I( b9 t. F
+------------------+-------+, E4 W& R2 X4 C0 J; n, Z
| Variable_name | Value |
) x; t9 \9 B% |" L; x+------------------+-------+
' s4 n; t" X- `" _# d* d# K+ J| old_passwords | ON   |
3 @* C3 H& v* v8 A* F6 ~+------------------+-------+
/ h% ^4 g2 F$ I( ?7 d1 row in set (0.00 sec)
: o" q: r# g4 n3 o2 S& a8 q
5 e6 X1 H3 O0 F4 j, bold_password  ==> ON  撠梯”蝷 /etc/my.cnf  鋆 old_passwords=1  閮剖16蝣,撠摰閮剔 0 嗅mysqld ==> service mysqld restart) n) |6 o  i4 p
mysql prompt銝頛詨:
- k9 |9 D. @4 Z; K1 k3 \: Mmysql> SET old_passwords=FALSE;  & @) `* t5 _: c8 j
瑼X叮ysql.user 瘥撖蝣潮瑕漲:  X& i1 Y7 s& r; `
mysql> SELECT 'User', 'Host', Length('Password') FROM mysql.user;# j4 y& Y. s/ A, E3 W& d. j
憒瘝寞41雿,Length('Password')甈雿閰脤賣160(銵函內瘝閮剖蝣) 8 f. f5 P: L* \! N3 Z
" ^9 m4 s! r' v; v! U6 B- L
閮剖靘撖蝣:
- A( P# f: B5 qmysql> SET PASSWORD FOR 'root'@'192.168.1.1' = PASSWORD('靘撖蝣');    // 撠敹閬詨靘 撣唾@IP 湔,銝閬寥臭
+ ^$ y3 n3 i  ?6 o& smysql> flush privileges;7 L; w0 Z, s2 Q- x7 q3 k, J

! x& o9 t3 S$ w  H; Y, W6 s頛詨 SELECT 'User', 'Host', Length('Password') FROM mysql.user; 瑼X亙蝣澆漲,撠勗舐潛曉寧root 撖蝣潮瑕漲撌脫寧41蝣
3 Q3 C% ^+ _  z) L( A, N瘜冽:
5 x; Y2 [* t2 d憒撣唾憭芸,臭誑啣憿閮剖蝣,粹閮剖蝣 SET PASSWORD FOR 芷撠亙蝣,銝 old_passwords=0 撠撖蝣潮敶梢
===========================================================================' p3 Y& V# F8 i, G; W1 n
鄉ysql蝝 8.0.21,php逅ysql箇2銵errors:
5 R) i$ b2 R7 R! Y6 vmysqli_real_connect(): Server sent charset (255) unknown to the client. Please, report to the developers0 a" P. p- K* E5 ?
mysqli_real_connect(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers
# e) E7 ]4 f$ x: ^% k:
* S# x6 W1 U4 h* j% V
決ySQL 8.0.21銝哨caching_sha2_password舫隤頨思遢撽霅隞塚銝臭誑敺mysql_native_password隞亙php銝詨捆臭誑蝝php嚗銋臭誑靽格遍ySQL蝵柴 曆犖瘙箏靽格遍ySQL蝵:% J7 z+ e1 l, }
vi /etc/my.cnf  乩:
* o/ F# g9 g, E+ S* G0 G# S2 f# ?[mysqld]& `: C# u% ^  ?/ s  ^6 v! q
: d3 U) q9 A! |* t, i8 ^- ^
character-set-server=utf83 l! f- e' r/ w7 J0 h
default_authentication_plugin=mysql_native_password( y" y& J2 C8 w4 o
& g) a' Q( B( Y
[mysql]! C; J( ?6 u8 R2 g% o1 v4 u
default-character-set=utf8
7 j8 c, J( _& [* V: T3 t) U! H8 D# R
[client]
* ^4 }) D5 }# z: w6 ^" Ldefault-character-set=utf8
1 v% h* A9 x* s; i
" C0 e' O/ W- y2 c+ Z嗅mysqld
+ v9 j8 o# Q3 O- y0 q% @6 \service mysqld restart# H& |% [; y' R; t0 `% N4 D$ t
摰!!8 e* M' }+ M8 x+ j& }3 L6 f
9 a  T. n+ g# A5 ^* E3 C
3 G4 w1 f( S4 {" j

雿輻券

祉蝛閬

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

QQ|撠暺撅||52AV璈A

GMT+8, 2026-1-27 02:16 , Processed in 0.063614 second(s), 16 queries .

蝯∠.撱

[email protected] | QQ:2405733034     since 2015-01

鋆貉憒 敹恍敺 餈銵