52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
     
亦: 4892|敺: 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').9 s; T" Y, z* c
( r! Q! B7 R3 m; N
臬歉hp 5.3隞亙撖蝣潭16雿蝺函Ⅳ,啁php 5.3隞亙41雿蝺函Ⅳ,mysql 5.2 隞亙閮凋16蝣,隞交甇斤車航炊.: v3 B  i$ ?* a- Z/ l1 P) k# R4 j
閮箸瑚銝mysql: (php 5.6.38 , mysql 5.1.73)
0 J# g9 {- q7 T# H& d: q餃叮ysql 嗅頛詨 : # g& ~( x9 d( a- [2 F
mysql> SHOW VARIABLES LIKE 'old_passwords';
: s/ [$ L; y8 w) u- b7 y" G% ?$ H+------------------+-------+
# q& j3 C3 S* g* J| Variable_name | Value |* z+ L9 O$ o7 ?0 g1 z, |
+------------------+-------++ a* L1 V7 V5 `. E( x8 s
| old_passwords | ON   |
0 a- Q$ L8 C9 S9 k' H, U4 P9 R+------------------+-------+: d# \$ f1 z2 }$ J' z
1 row in set (0.00 sec)  l9 C& k6 o+ w( D- n; L

8 K& A: \( C% j9 s. }7 x8 oold_password  ==> ON  撠梯”蝷 /etc/my.cnf  鋆 old_passwords=1  閮剖16蝣,撠摰閮剔 0 嗅mysqld ==> service mysqld restart( E6 [. T* P  R1 b7 S9 b& T- y
mysql prompt銝頛詨:( @. H" ~9 b5 c1 \/ I7 Y0 y; I
mysql> SET old_passwords=FALSE;  " o: T! ~* k- r5 J) O6 B! J- x9 k
瑼X叮ysql.user 瘥撖蝣潮瑕漲:
) n; y, I  S/ e) j0 bmysql> SELECT 'User', 'Host', Length('Password') FROM mysql.user;
+ `3 m# d6 V( r/ P: {. Z憒瘝寞41雿,Length('Password')甈雿閰脤賣160(銵函內瘝閮剖蝣) $ \: P3 W5 d/ i8 |

9 z* v: \( M3 m1 }閮剖靘撖蝣:
; K8 ]- [" h; D. q5 V) fmysql> SET PASSWORD FOR 'root'@'192.168.1.1' = PASSWORD('靘撖蝣');    // 撠敹閬詨靘 撣唾@IP 湔,銝閬寥臭/ x/ s& a1 V" C! I2 j: O
mysql> flush privileges;
' h" V; k# a7 S# ?+ r# d
2 [7 t5 y3 o+ }1 ?' p) k頛詨 SELECT 'User', 'Host', Length('Password') FROM mysql.user; 瑼X亙蝣澆漲,撠勗舐潛曉寧root 撖蝣潮瑕漲撌脫寧41蝣
1 g" ^3 i% K, n6 z/ \" x# P瘜冽:9 L* w: J+ y! b: r4 i/ f- w7 U3 d
憒撣唾憭芸,臭誑啣憿閮剖蝣,粹閮剖蝣 SET PASSWORD FOR 芷撠亙蝣,銝 old_passwords=0 撠撖蝣潮敶梢
===========================================================================* U% A  V# V( v. T$ ]
鄉ysql蝝 8.0.21,php逅ysql箇2銵errors:$ [3 d( i& i0 T0 W7 ^& p
mysqli_real_connect(): Server sent charset (255) unknown to the client. Please, report to the developers# K9 ~% n  e9 p
mysqli_real_connect(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers
( ~3 i1 ~$ y% F, R! G, X:

  G# [( W% ~/ g. t! Q決ySQL 8.0.21銝哨caching_sha2_password舫隤頨思遢撽霅隞塚銝臭誑敺mysql_native_password隞亙php銝詨捆臭誑蝝php嚗銋臭誑靽格遍ySQL蝵柴 曆犖瘙箏靽格遍ySQL蝵:
& I1 h! m& V: L/ ]vi /etc/my.cnf  乩:! O" w* F$ b  V. j# F2 H
[mysqld]
# a; i# q7 Z3 T, X! u1 @' Z! z2 h3 U* F
character-set-server=utf8
, O4 _3 ?1 u: e9 c1 u" y  {4 Sdefault_authentication_plugin=mysql_native_password; B! O& g: x% N

3 z% @7 V2 y* c  d/ L# K[mysql]* U% [4 N% z9 a% {: d
default-character-set=utf8
" P) ~+ Y, v$ i- e* H
( C* r/ b$ f# P, L9 y* R[client]( C. q$ P- J8 O& w- M6 B5 L
default-character-set=utf8
* u& t) f; r8 z! B+ o; M' I! ?. h) n- k
嗅mysqld" P5 p2 |; _: ^+ I1 z) I( B* Z
service mysqld restart# s$ c8 `: I9 q$ l
摰!!
- o- [' [; n9 w1 [- n
- ^7 `$ s) d6 {( g: j4 x8 L

( C# M1 Y! x+ Z" Z! n% O

雿輻券

祉蝛閬

撠蝝詨

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

QQ|撠暺撅||52AV璈A

GMT+8, 2025-12-5 18:39 , Processed in 0.065676 second(s), 16 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵