52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
     
亦: 3345|敺: 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').
8 X9 W7 F0 j9 z6 v) ~
, f8 n! L, V" X1 ^! ?臬歉hp 5.3隞亙撖蝣潭16雿蝺函Ⅳ,啁php 5.3隞亙41雿蝺函Ⅳ,mysql 5.2 隞亙閮凋16蝣,隞交甇斤車航炊.% S. n2 s6 f1 A
閮箸瑚銝mysql: (php 5.6.38 , mysql 5.1.73)
7 C1 \: Q# n* T8 y' u. y6 K餃叮ysql 嗅頛詨 :
: y6 e: S9 ?0 G% g8 m/ M: K, Pmysql> SHOW VARIABLES LIKE 'old_passwords';
/ p7 K& e+ j5 x) e8 _1 v1 r. c+------------------+-------+
, D$ ]! e4 t3 [9 e2 l: S$ i$ h; O$ {| Variable_name | Value |& F/ V& @: i6 D
+------------------+-------+. b6 i+ W/ ~) l8 f
| old_passwords | ON   |% V. D/ a0 H+ |0 X6 |. Y
+------------------+-------+
+ Z4 h1 n' a2 Z8 W7 E1 row in set (0.00 sec)
- d% o7 k# u; F$ I, \& B
. v/ I6 D- }0 K0 `7 M0 fold_password  ==> ON  撠梯”蝷 /etc/my.cnf  鋆 old_passwords=1  閮剖16蝣,撠摰閮剔 0 嗅mysqld ==> service mysqld restart
. N0 ~' Z! v5 ^( }" ~0 s mysql prompt銝頛詨:
' ^4 o- E! u9 I3 g0 k6 d, Omysql> SET old_passwords=FALSE;  0 }( J- E' N( C
瑼X叮ysql.user 瘥撖蝣潮瑕漲:- F7 C/ j+ ~9 }" N
mysql> SELECT 'User', 'Host', Length('Password') FROM mysql.user;4 ?. ~5 ?% M! P' d
憒瘝寞41雿,Length('Password')甈雿閰脤賣160(銵函內瘝閮剖蝣)
( o& ~: L! q/ b# c$ k8 ?7 @8 Y( T* W5 e, r3 K% D# e. ~
閮剖靘撖蝣:
2 J) `5 t. o, t* w/ jmysql> SET PASSWORD FOR 'root'@'192.168.1.1' = PASSWORD('靘撖蝣');    // 撠敹閬詨靘 撣唾@IP 湔,銝閬寥臭* H3 f% i$ F) U" E5 a
mysql> flush privileges;. R6 w+ }, V6 Z% g( F0 `4 c8 u
4 C* f' n5 N0 m" z# c) Z
頛詨 SELECT 'User', 'Host', Length('Password') FROM mysql.user; 瑼X亙蝣澆漲,撠勗舐潛曉寧root 撖蝣潮瑕漲撌脫寧41蝣2 t5 |) L2 W  a
瘜冽:
  K  a5 @" H3 b$ }# o# y憒撣唾憭芸,臭誑啣憿閮剖蝣,粹閮剖蝣 SET PASSWORD FOR 芷撠亙蝣,銝 old_passwords=0 撠撖蝣潮敶梢
===========================================================================
2 h0 N# h. T6 F& v# ~  f  w* n鄉ysql蝝 8.0.21,php逅ysql箇2銵errors:
4 d0 ]+ c. o' ]0 Z0 `0 Y3 o2 ?. [mysqli_real_connect(): Server sent charset (255) unknown to the client. Please, report to the developers
; y& f* [% h% t' U6 Lmysqli_real_connect(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers
' @8 o9 r: E" E4 i2 Q# l7 ^:
: [; u" a8 ^4 h  N" x/ f
決ySQL 8.0.21銝哨caching_sha2_password舫隤頨思遢撽霅隞塚銝臭誑敺mysql_native_password隞亙php銝詨捆臭誑蝝php嚗銋臭誑靽格遍ySQL蝵柴 曆犖瘙箏靽格遍ySQL蝵:- V4 o1 f& z- H" k5 }5 ]) ]
vi /etc/my.cnf  乩:
7 O- o. N7 }9 M[mysqld]
0 ?; h; d' Y- `0 Q% }3 ]9 N9 Y
6 ~0 [% [* s5 @* f' {# B. |% y3 @- P0 scharacter-set-server=utf8
! G$ \/ d7 E' R" I/ y$ J3 i/ G! |default_authentication_plugin=mysql_native_password
, [  P( A& ]8 w
4 f. }8 {4 {6 s) }/ W/ H[mysql]
7 [) n( f1 J* w( Edefault-character-set=utf8
  k% X- K9 ]. }' K1 @+ {7 a8 o+ I6 b5 H& U: l5 f
[client]- U6 L2 [5 h+ `2 f( I7 s; H
default-character-set=utf8
& z# k" w6 z# x) n2 [1 l/ N  l+ W6 c. M! q" ^, ]
嗅mysqld
. d: g; l* j! Y: e) hservice mysqld restart
! Y& u, q" q/ Z& ~* a. ~摰!!: l' l2 K1 c( Q0 H: `; j

0 i% _, X2 w- r! z" l, s7 m' _( F5 i+ i' i. `* m

雿輻券

祉蝛閬

BT蝳

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

QQ|撠暺撅||52AV璈A

GMT+8, 2024-9-17 22:11 , Processed in 0.062543 second(s), 16 queries .

蝯∠.撱

[email protected] | QQ:2405733034     since 2015-01

鋆貉憒 敹恍敺 餈銵