52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
     
亦: 5001|敺: 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').
. C" K/ x% j2 ~2 d3 \
9 U! c3 w5 w  d* P8 Z% d$ U) p臬歉hp 5.3隞亙撖蝣潭16雿蝺函Ⅳ,啁php 5.3隞亙41雿蝺函Ⅳ,mysql 5.2 隞亙閮凋16蝣,隞交甇斤車航炊.+ k2 c  C& b( W* O
閮箸瑚銝mysql: (php 5.6.38 , mysql 5.1.73)
9 W  W- M: x$ F. F餃叮ysql 嗅頛詨 : 4 A1 H. J! E+ _; ~( p
mysql> SHOW VARIABLES LIKE 'old_passwords';
6 a( p. g1 E" O/ U6 E. P) N+------------------+-------+
0 b" @" K# H: l3 {: q| Variable_name | Value |
. z! t6 w+ p! S7 ^+------------------+-------+# W1 t1 i1 Q. p" m
| old_passwords | ON   |
. G% N5 x: Y8 P' a; D( p3 o+------------------+-------+
0 z# L/ q& H0 i6 _6 U; i% W9 J- h1 row in set (0.00 sec)% I# u; {/ \8 f$ k. F7 v
0 {) u% ]7 V) u6 X+ \8 K1 N7 f4 k" ^
old_password  ==> ON  撠梯”蝷 /etc/my.cnf  鋆 old_passwords=1  閮剖16蝣,撠摰閮剔 0 嗅mysqld ==> service mysqld restart' W( O+ n/ e7 b1 A- v7 E2 \6 F
mysql prompt銝頛詨:
# r6 g) d' Z, n3 ]" I/ ~3 xmysql> SET old_passwords=FALSE;  
0 d8 q7 M2 s1 W7 O, ^  F$ s+ z瑼X叮ysql.user 瘥撖蝣潮瑕漲:
2 `1 j! o" q, r  U' ~( r+ ~/ ]mysql> SELECT 'User', 'Host', Length('Password') FROM mysql.user;
2 d- y" A5 n) `8 G0 q0 }0 F憒瘝寞41雿,Length('Password')甈雿閰脤賣160(銵函內瘝閮剖蝣)
% K, P. y. [8 b5 Z# U
% D5 H( X: `& a" V2 l閮剖靘撖蝣:
' s* z' g- `; x6 vmysql> SET PASSWORD FOR 'root'@'192.168.1.1' = PASSWORD('靘撖蝣');    // 撠敹閬詨靘 撣唾@IP 湔,銝閬寥臭1 ~3 l5 N) F- [/ T
mysql> flush privileges;
5 R8 K8 a( o, H  y2 ^. k/ V! x& i! O6 F/ U6 s
頛詨 SELECT 'User', 'Host', Length('Password') FROM mysql.user; 瑼X亙蝣澆漲,撠勗舐潛曉寧root 撖蝣潮瑕漲撌脫寧41蝣
* k( \+ ]% r' u6 A1 l& b, G" T瘜冽:2 n) p0 ^- a/ i, m$ }& @
憒撣唾憭芸,臭誑啣憿閮剖蝣,粹閮剖蝣 SET PASSWORD FOR 芷撠亙蝣,銝 old_passwords=0 撠撖蝣潮敶梢
===========================================================================
/ X* b+ B" U4 y: j# n鄉ysql蝝 8.0.21,php逅ysql箇2銵errors:
) r# C& s, _# z4 K6 Fmysqli_real_connect(): Server sent charset (255) unknown to the client. Please, report to the developers+ M1 s. R+ k6 i
mysqli_real_connect(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers, s, d+ {; U: J8 q2 c0 m+ `; c/ ?
:

- U: o4 G- p6 @5 u6 Y決ySQL 8.0.21銝哨caching_sha2_password舫隤頨思遢撽霅隞塚銝臭誑敺mysql_native_password隞亙php銝詨捆臭誑蝝php嚗銋臭誑靽格遍ySQL蝵柴 曆犖瘙箏靽格遍ySQL蝵:
& F0 B( I/ t# z6 qvi /etc/my.cnf  乩:
" W8 T+ R- S6 D' j& `: \[mysqld]
% |: |  v  o; k. R- c+ @- Z# N8 k( i
, k  l9 F# Q8 J7 kcharacter-set-server=utf8( S8 g0 B6 v6 j9 v# S! _
default_authentication_plugin=mysql_native_password
4 q0 h5 t5 v% b5 V9 @; B/ S9 @. w  w3 O% P. i1 D
[mysql]4 g- P  T1 v! i7 y& d# a1 w1 L
default-character-set=utf8; Q( s; G4 `1 x6 }1 c
; v* Z" g2 R( j2 d) {
[client]1 f+ g6 l" |" A$ I: N0 c/ ?' A6 A
default-character-set=utf8
% [* P( y' b9 |7 p+ Z& d3 ]- @" Z  C/ q, l: M) `; ?2 |% g5 E: X
嗅mysqld1 W; r& s( r7 ]* C% F
service mysqld restart( t+ w7 K0 o5 z
摰!!
8 Q, C/ q6 h* w1 r6 k

  d- \. T+ r* r1 r+ ~
+ u9 K& d# ^8 z! _

雿輻券

祉蝛閬

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

QQ|撠暺撅||52AV璈A

GMT+8, 2026-2-7 22:10 , Processed in 0.063806 second(s), 16 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵