52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
     
亦: 4936|敺: 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').2 e6 {" j% o  i6 H( l

! B& e  ~" x$ L/ t" H臬歉hp 5.3隞亙撖蝣潭16雿蝺函Ⅳ,啁php 5.3隞亙41雿蝺函Ⅳ,mysql 5.2 隞亙閮凋16蝣,隞交甇斤車航炊.
/ o4 }$ b2 \$ b4 m  x% V/ F閮箸瑚銝mysql: (php 5.6.38 , mysql 5.1.73)
4 v, w# k# j& u1 n餃叮ysql 嗅頛詨 :
( y* [. i5 I  ]# A3 Z* [  umysql> SHOW VARIABLES LIKE 'old_passwords';1 N& Y+ j6 T0 y" P9 W
+------------------+-------+- N" O( D6 s$ |3 F: A+ g. L9 j/ v
| Variable_name | Value |
% W: ^' p: ?- V+ A& [! d+------------------+-------+
5 n- E! j5 F# F; ]2 G8 z* [| old_passwords | ON   |
4 Q, {6 g" z" Q1 q6 S+------------------+-------+: A( z9 n. c$ W% q; N8 {. Y
1 row in set (0.00 sec)$ i6 P8 H& C, S8 J* N
: l4 S7 Z# R1 D8 J
old_password  ==> ON  撠梯”蝷 /etc/my.cnf  鋆 old_passwords=1  閮剖16蝣,撠摰閮剔 0 嗅mysqld ==> service mysqld restart
/ ^  A' A0 h! E) r' Z) q mysql prompt銝頛詨:
# j* Z) Q' w  U1 s$ I7 Fmysql> SET old_passwords=FALSE;  ( u: d: {6 ]! F3 e
瑼X叮ysql.user 瘥撖蝣潮瑕漲:
0 n/ Z# `3 r' L1 Hmysql> SELECT 'User', 'Host', Length('Password') FROM mysql.user;" L, d" G- S* w; T$ h
憒瘝寞41雿,Length('Password')甈雿閰脤賣160(銵函內瘝閮剖蝣) 4 \0 Q! I; g9 T/ I
" R- h6 t3 _( _- t6 x  w
閮剖靘撖蝣:
4 @4 {- n) B1 J1 xmysql> SET PASSWORD FOR 'root'@'192.168.1.1' = PASSWORD('靘撖蝣');    // 撠敹閬詨靘 撣唾@IP 湔,銝閬寥臭. |. K& G3 p: K2 l& c
mysql> flush privileges;
$ |9 w$ S0 Z/ r; M. G( ^) v& G- @# c# ^& a" ?" C
頛詨 SELECT 'User', 'Host', Length('Password') FROM mysql.user; 瑼X亙蝣澆漲,撠勗舐潛曉寧root 撖蝣潮瑕漲撌脫寧41蝣
- E* @; q& u; S7 v6 @瘜冽:6 s1 M& E. e# b+ ^, J! I
憒撣唾憭芸,臭誑啣憿閮剖蝣,粹閮剖蝣 SET PASSWORD FOR 芷撠亙蝣,銝 old_passwords=0 撠撖蝣潮敶梢
===========================================================================5 l& \; M( Q: Y( \
鄉ysql蝝 8.0.21,php逅ysql箇2銵errors:
# q0 F+ b- g5 N8 |mysqli_real_connect(): Server sent charset (255) unknown to the client. Please, report to the developers
1 c; D4 a/ T4 c. {  D9 Dmysqli_real_connect(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers3 X) i: J% h1 ?8 s/ ^; I
:
6 x7 o" ?% A; K3 h
決ySQL 8.0.21銝哨caching_sha2_password舫隤頨思遢撽霅隞塚銝臭誑敺mysql_native_password隞亙php銝詨捆臭誑蝝php嚗銋臭誑靽格遍ySQL蝵柴 曆犖瘙箏靽格遍ySQL蝵:9 P0 C; T2 D3 ]- v' o; @
vi /etc/my.cnf  乩:
7 ?: u# D6 g' L( E# L[mysqld]
7 ]* W: d8 ~  G1 ]/ B2 i  M5 x9 z6 v6 I" f/ H
character-set-server=utf8+ v. a6 J# W; b* @
default_authentication_plugin=mysql_native_password. o" Q9 b. S. _) ~# O1 A: ~* W, T

4 {% S( f/ g) \% F: `: ^[mysql]
" @  c, X7 H) k) [: `default-character-set=utf8
, z$ v! L! E6 Q3 W, E5 I
% O. o4 v/ A, J! x& H& a7 y$ f1 V[client]; ^+ X1 h5 w) V2 U5 h9 C
default-character-set=utf82 E# F' t$ ^* R% I& R2 q: @
8 e3 `; U9 j: J9 M6 j8 C
嗅mysqld- Z- P- J0 [8 \( d/ |  m$ F1 k# J
service mysqld restart
6 g( y/ n& [6 [! m摰!!" \1 R0 ~! v  n+ ^2 g: x! C2 V! s! \' ^

) }5 Q4 v8 {% O% ]( l2 f
% P6 }- t1 q5 S/ E

雿輻券

祉蝛閬

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

QQ|撠暺撅||52AV璈A

GMT+8, 2025-12-24 11:35 , Processed in 0.067274 second(s), 17 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵