52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
  • 伐AI璁函移瘛怠伐
     
亦: 4975|敺: 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').1 r) I6 o% m$ b) \

- N6 a! O2 a' A6 f$ U臬歉hp 5.3隞亙撖蝣潭16雿蝺函Ⅳ,啁php 5.3隞亙41雿蝺函Ⅳ,mysql 5.2 隞亙閮凋16蝣,隞交甇斤車航炊.) E7 q5 V2 q* x) t" b; R. B& w
閮箸瑚銝mysql: (php 5.6.38 , mysql 5.1.73)) _6 p) G7 N5 W# b
餃叮ysql 嗅頛詨 :
$ w- q8 \4 u! {8 ]# Y! F7 g* vmysql> SHOW VARIABLES LIKE 'old_passwords';
/ @7 k' Y3 z7 F. T1 K7 d, L+------------------+-------+' m$ D2 |: n) ^: Y: A" U0 }$ i& u- W
| Variable_name | Value |6 d( G9 g) }/ L0 p8 H0 W
+------------------+-------+  S) T3 _! U* R! W' z
| old_passwords | ON   |
! j$ C0 Q# ~! A0 O, m- M7 d+------------------+-------+
& q- V$ h: g7 ~# P1 row in set (0.00 sec)/ d5 {+ e! c) L7 W7 [' I3 u5 @6 j

4 g* m6 y4 c* Z! e1 uold_password  ==> ON  撠梯”蝷 /etc/my.cnf  鋆 old_passwords=1  閮剖16蝣,撠摰閮剔 0 嗅mysqld ==> service mysqld restart, v5 s" t& X) I& t' U7 y
mysql prompt銝頛詨:$ D! E; o2 i+ \' a
mysql> SET old_passwords=FALSE;  
" ~! s) `) |  G: K$ I瑼X叮ysql.user 瘥撖蝣潮瑕漲:
/ B# H' A& ~* |3 H5 hmysql> SELECT 'User', 'Host', Length('Password') FROM mysql.user;
1 [' }& c9 I3 e  f9 [憒瘝寞41雿,Length('Password')甈雿閰脤賣160(銵函內瘝閮剖蝣) * ~: U: E; \' b7 ~' ]* w; x

/ c; e8 `7 j$ R$ q' A8 t閮剖靘撖蝣:
$ l" @! f$ y7 S) q6 |$ G5 imysql> SET PASSWORD FOR 'root'@'192.168.1.1' = PASSWORD('靘撖蝣');    // 撠敹閬詨靘 撣唾@IP 湔,銝閬寥臭
6 Y5 x, P  m$ }5 k# `mysql> flush privileges;& j: E; |) s3 q" ~' K8 l3 N! o

" w; W) O3 R( I, n' q3 }9 S頛詨 SELECT 'User', 'Host', Length('Password') FROM mysql.user; 瑼X亙蝣澆漲,撠勗舐潛曉寧root 撖蝣潮瑕漲撌脫寧41蝣
% j3 l" r) E, \1 d" m0 }瘜冽:
$ R' h/ U2 I# k" _8 Y9 J7 i  k憒撣唾憭芸,臭誑啣憿閮剖蝣,粹閮剖蝣 SET PASSWORD FOR 芷撠亙蝣,銝 old_passwords=0 撠撖蝣潮敶梢
===========================================================================
1 V+ R# z9 Y& }" I; W鄉ysql蝝 8.0.21,php逅ysql箇2銵errors:
7 }9 N# `" q, zmysqli_real_connect(): Server sent charset (255) unknown to the client. Please, report to the developers
2 K/ x. |  v. v% p- M, ~mysqli_real_connect(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers0 D. y2 |) E3 y- G
:
6 t7 j$ K: A- D, d# N* W1 I
決ySQL 8.0.21銝哨caching_sha2_password舫隤頨思遢撽霅隞塚銝臭誑敺mysql_native_password隞亙php銝詨捆臭誑蝝php嚗銋臭誑靽格遍ySQL蝵柴 曆犖瘙箏靽格遍ySQL蝵:
0 t+ R6 }" E! q1 Q+ k  q: a/ J, y! Pvi /etc/my.cnf  乩:6 l' G4 C% ]' V4 G
[mysqld]4 q; }/ G+ `5 w& ^5 ]

" c, R, l3 x, b& t& Echaracter-set-server=utf8
/ n4 l' q. w; P. M/ U6 Adefault_authentication_plugin=mysql_native_password! [" m7 V2 O* x7 }

, @+ l) l( y: \1 T% U[mysql]1 t" {* X& o$ n1 t
default-character-set=utf8
0 h6 C4 c6 t, n0 Z( ~! \
" K7 y9 t7 K3 R5 w' w[client]1 J$ q$ @9 z/ Z' b$ Q
default-character-set=utf8
' o& Q3 ^' _2 G* }  ]( ]
( n- k% ?; C6 z! S: Y嗅mysqld
2 K. ~* Q, N: p/ k0 z' Wservice mysqld restart# a# M& f+ V" n
摰!!' \- ^0 h( b% o. ?6 t) E
. t' f. y& s+ p/ U1 s

2 y/ `" ^2 y" h

雿輻券

祉蝛閬

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

QQ|撠暺撅||52AV璈A

GMT+8, 2026-1-27 06:21 , Processed in 0.064026 second(s), 16 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵