52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
  • 伐AI璁函移瘛怠伐
     
亦: 4830|敺: 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').
; X$ @8 d+ q; y0 O, x0 ?9 F# b9 v! `: W( }! j
臬歉hp 5.3隞亙撖蝣潭16雿蝺函Ⅳ,啁php 5.3隞亙41雿蝺函Ⅳ,mysql 5.2 隞亙閮凋16蝣,隞交甇斤車航炊.
1 T- d6 b5 L7 `: Q, G% g0 c閮箸瑚銝mysql: (php 5.6.38 , mysql 5.1.73)
1 A$ q7 y8 g# t; k/ w  p餃叮ysql 嗅頛詨 :
% X1 p! G7 j$ N$ omysql> SHOW VARIABLES LIKE 'old_passwords';
& c: V( a& N# C. x5 g+------------------+-------+: m; V; Y' k! K7 ~5 D; f; _1 t
| Variable_name | Value |  U0 ]) g7 @/ b5 B$ D. O% p
+------------------+-------+
( ?$ _, x+ E) V- h* {| old_passwords | ON   |& ]! F+ b, l3 [* Y2 _. r
+------------------+-------+
. Y# v* Z; ]. A. v5 P6 H; A7 I1 row in set (0.00 sec)2 D9 L' E6 s' B9 Y2 {

* R+ a- C& C  {; D# k0 zold_password  ==> ON  撠梯”蝷 /etc/my.cnf  鋆 old_passwords=1  閮剖16蝣,撠摰閮剔 0 嗅mysqld ==> service mysqld restart, U! y3 J* p7 B
mysql prompt銝頛詨:
: k9 z1 b0 X2 L* Amysql> SET old_passwords=FALSE;  3 \" q& M4 N/ H4 A) j) P5 _
瑼X叮ysql.user 瘥撖蝣潮瑕漲:
5 a3 m/ A% t4 x* R, i* n& L5 U3 fmysql> SELECT 'User', 'Host', Length('Password') FROM mysql.user;1 n( C6 O$ q2 {- B9 d1 Q+ q
憒瘝寞41雿,Length('Password')甈雿閰脤賣160(銵函內瘝閮剖蝣)
% S9 u% a  Q8 `( A8 V1 `, Z* D3 Y- v' k; e% b
閮剖靘撖蝣:7 \* d" v2 O) j
mysql> SET PASSWORD FOR 'root'@'192.168.1.1' = PASSWORD('靘撖蝣');    // 撠敹閬詨靘 撣唾@IP 湔,銝閬寥臭
3 _* {. r, y5 Y6 y) tmysql> flush privileges;9 `# }8 L+ l/ n6 N* f
5 b! J& u. j. x. w  Z  u) H6 i
頛詨 SELECT 'User', 'Host', Length('Password') FROM mysql.user; 瑼X亙蝣澆漲,撠勗舐潛曉寧root 撖蝣潮瑕漲撌脫寧41蝣) P9 F6 }, Z9 _
瘜冽:% y# s$ s! W3 G' r2 N' N
憒撣唾憭芸,臭誑啣憿閮剖蝣,粹閮剖蝣 SET PASSWORD FOR 芷撠亙蝣,銝 old_passwords=0 撠撖蝣潮敶梢
===========================================================================
" g% H: |: Y0 M1 V' o鄉ysql蝝 8.0.21,php逅ysql箇2銵errors:( Z8 o' ?9 X6 M3 e
mysqli_real_connect(): Server sent charset (255) unknown to the client. Please, report to the developers
( a2 ?4 e7 v+ ]! A- T! xmysqli_real_connect(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers
; i& I- U, N! G! K$ K& m:

* F0 m$ Z/ m. z. Q8 J決ySQL 8.0.21銝哨caching_sha2_password舫隤頨思遢撽霅隞塚銝臭誑敺mysql_native_password隞亙php銝詨捆臭誑蝝php嚗銋臭誑靽格遍ySQL蝵柴 曆犖瘙箏靽格遍ySQL蝵:0 O4 I& a5 L" `2 n0 ?, Y
vi /etc/my.cnf  乩:
4 @: B4 D. r4 e0 e" k3 m* V[mysqld]
+ ?0 r) a2 G, V' X
7 g* K8 K+ \- U/ m9 B- a9 Vcharacter-set-server=utf85 L% t4 ~, |3 }4 @
default_authentication_plugin=mysql_native_password
( @8 K/ c9 _% l0 g9 P( d* n  L6 Z1 v/ Q# o0 m" u, T) H7 E1 d
[mysql]
) s& R- \& Z! h8 |9 wdefault-character-set=utf8
8 X5 @9 d. a, a0 E
' q$ x+ j! t# X7 J[client]& K+ v/ u9 z! j+ z- _
default-character-set=utf8# c3 J9 O( ?1 k. b

# q' q2 E' _& Z; p0 c嗅mysqld2 o7 ?8 I% g/ u3 P5 H$ A+ R0 F
service mysqld restart* |* G  Q8 h3 r* u" B, R+ y
摰!!  a* m8 ~& u) c- F/ Y. u9 E
! n# ~9 G( K5 ~) h) L  Y

* U- D: ]* W* C  W  G" ]

雿輻券

祉蝛閬

撠蝝詨

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

QQ|撠暺撅||52AV璈A

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

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵