52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
     
亦: 5138|敺: 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').; g" g# A; k( D' B$ ~5 ]7 z
- ~3 p: X& u% M; \9 K4 C
臬歉hp 5.3隞亙撖蝣潭16雿蝺函Ⅳ,啁php 5.3隞亙41雿蝺函Ⅳ,mysql 5.2 隞亙閮凋16蝣,隞交甇斤車航炊.3 F5 L  S! x7 \5 u! ~# ]
閮箸瑚銝mysql: (php 5.6.38 , mysql 5.1.73)
. @% i; p" v0 R8 H) v  ~) D3 ~% o! T餃叮ysql 嗅頛詨 : 8 b" g0 i# i, \) i4 x4 k0 g1 S( q- g
mysql> SHOW VARIABLES LIKE 'old_passwords';
  ?$ @& Q% a  V) O, [7 e+------------------+-------+0 H1 {( {& C! a+ u0 ]
| Variable_name | Value |- C: V  E" S4 d- l' u
+------------------+-------+6 A' \$ n) }8 m$ y9 |) U
| old_passwords | ON   |7 x+ \1 G( U. `, r$ x
+------------------+-------+
' m( H5 D3 Q1 T& i5 `- R1 row in set (0.00 sec)# L: e" ~" q* |' S% D

! `8 N9 A3 s" j  Gold_password  ==> ON  撠梯”蝷 /etc/my.cnf  鋆 old_passwords=1  閮剖16蝣,撠摰閮剔 0 嗅mysqld ==> service mysqld restart
, v  [  g6 x! e" J8 |8 n9 b% V mysql prompt銝頛詨:
- f% M3 N" A& |& J* l- x8 [% h' lmysql> SET old_passwords=FALSE;  
. K; ^9 ~- K- U- A7 x( M# X7 S瑼X叮ysql.user 瘥撖蝣潮瑕漲:0 e1 E+ `: r3 r1 I& p, F. x
mysql> SELECT 'User', 'Host', Length('Password') FROM mysql.user;
8 w2 N4 a' I7 _" Z" v憒瘝寞41雿,Length('Password')甈雿閰脤賣160(銵函內瘝閮剖蝣)
9 C( W# C) n  v9 G
( C8 O! u- h( V1 _* F) Q7 j閮剖靘撖蝣:
: j, A4 e1 x* n! d5 H5 \5 b, Nmysql> SET PASSWORD FOR 'root'@'192.168.1.1' = PASSWORD('靘撖蝣');    // 撠敹閬詨靘 撣唾@IP 湔,銝閬寥臭  p, K( Q: Q. n) |" r/ P6 |9 Y& X0 y1 u
mysql> flush privileges;
6 n/ L1 {$ Z! L- {, b/ ?4 e+ B7 b3 R% S' O9 g) @/ @
頛詨 SELECT 'User', 'Host', Length('Password') FROM mysql.user; 瑼X亙蝣澆漲,撠勗舐潛曉寧root 撖蝣潮瑕漲撌脫寧41蝣  z. i& t5 u: Z! U" b
瘜冽:
+ H0 |, i. n) e) g8 s憒撣唾憭芸,臭誑啣憿閮剖蝣,粹閮剖蝣 SET PASSWORD FOR 芷撠亙蝣,銝 old_passwords=0 撠撖蝣潮敶梢
===========================================================================6 N$ j/ j4 a! J: g. p% k
鄉ysql蝝 8.0.21,php逅ysql箇2銵errors:- j& b5 L7 x# q2 H, t
mysqli_real_connect(): Server sent charset (255) unknown to the client. Please, report to the developers! J2 Q/ L9 ^) ]: G3 l" w6 E. l
mysqli_real_connect(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers
. }6 W4 n* @' G* q$ {3 l: }8 `! f:
, n7 }7 \- x* [- [% ?
決ySQL 8.0.21銝哨caching_sha2_password舫隤頨思遢撽霅隞塚銝臭誑敺mysql_native_password隞亙php銝詨捆臭誑蝝php嚗銋臭誑靽格遍ySQL蝵柴 曆犖瘙箏靽格遍ySQL蝵:
& V" h6 t0 U. V$ uvi /etc/my.cnf  乩:
) N! D: E7 W9 J  l- Z# v[mysqld]
" B# p! c* v* \% {' a: _' P! ~. ~( |/ c+ z& W* j
character-set-server=utf8
' ]8 e6 r' _5 o  qdefault_authentication_plugin=mysql_native_password
/ U+ e. V. q  J& w# G6 k: P" N+ z
# b- U( l" @7 N- r  p[mysql]
& i1 a1 h7 b  ^3 J% X( O2 l) cdefault-character-set=utf8! `# J/ B( i  E. Y/ p

; c- v( U' Z2 Q$ q  }$ x[client]
& E. b# F& T. P2 |5 |" tdefault-character-set=utf8
2 c) r, `' n( ^; G0 m
/ _( Y+ V& P& k5 g' S5 q嗅mysqld3 i9 u1 t2 u0 w; g. Z9 n
service mysqld restart, O8 o" h* q5 F0 `0 `0 _
摰!!
6 x( S% S0 K( T6 V  [$ @& O, j

0 d3 s2 I" u6 X1 l# Z2 {% t7 W( K% ~( _1 ?# d

雿輻券

祉蝛閬

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

QQ|撠暺撅||52AV璈A

GMT+8, 2026-3-26 21:12 , Processed in 0.062224 second(s), 16 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵