52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
Yahoo!憟拇撠
望: 璈A
Google憟拇撠
望: 璈A
     
亦: 4052|敺: 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').
& G2 M9 g9 B4 L
. s  }: L# G3 M0 N7 y8 G' Y$ ^臬歉hp 5.3隞亙撖蝣潭16雿蝺函Ⅳ,啁php 5.3隞亙41雿蝺函Ⅳ,mysql 5.2 隞亙閮凋16蝣,隞交甇斤車航炊.
1 |, H( J/ M7 }0 z3 B閮箸瑚銝mysql: (php 5.6.38 , mysql 5.1.73)( V0 }# r6 q7 |" A
餃叮ysql 嗅頛詨 :
% Q* y4 y/ [6 |$ x  Tmysql> SHOW VARIABLES LIKE 'old_passwords';! `$ X6 |* \- p
+------------------+-------+
, f6 ~' ]$ ]7 d& g7 T9 J" B* w6 O3 z: h| Variable_name | Value |
* W' J! S2 d1 o( c$ E+------------------+-------+- y3 W9 B$ h' C) S6 @, j- S* f
| old_passwords | ON   |6 r! }& B. }' j, l: {
+------------------+-------+. Y* s' H- G, Y! ?7 i
1 row in set (0.00 sec), B$ d. ]# W7 }: ^/ a

, `, Y' [+ f8 v* w+ V+ N4 yold_password  ==> ON  撠梯”蝷 /etc/my.cnf  鋆 old_passwords=1  閮剖16蝣,撠摰閮剔 0 嗅mysqld ==> service mysqld restart
3 d, V  x/ z8 R" X mysql prompt銝頛詨:
! X/ s3 l- o$ u" N5 e. {. [mysql> SET old_passwords=FALSE;  ) N2 y; o0 C7 `7 u, Q* ~+ _
瑼X叮ysql.user 瘥撖蝣潮瑕漲:
9 v8 v3 E: V7 U# R$ u! g5 B8 |mysql> SELECT 'User', 'Host', Length('Password') FROM mysql.user;; H7 u' D9 |# G; o/ u5 |  w
憒瘝寞41雿,Length('Password')甈雿閰脤賣160(銵函內瘝閮剖蝣) 1 W* u7 F, m* Z9 E- a. V) T: Z
+ p; G  L  H4 x; K, ~$ i1 T
閮剖靘撖蝣:
" \7 ]2 J( c4 s& E% A4 _5 amysql> SET PASSWORD FOR 'root'@'192.168.1.1' = PASSWORD('靘撖蝣');    // 撠敹閬詨靘 撣唾@IP 湔,銝閬寥臭) q' J) _) }3 @1 R5 m
mysql> flush privileges;3 ~4 e' A: W8 C5 W' ~

/ H1 U4 p8 b- |- G3 G) A8 h& s4 e頛詨 SELECT 'User', 'Host', Length('Password') FROM mysql.user; 瑼X亙蝣澆漲,撠勗舐潛曉寧root 撖蝣潮瑕漲撌脫寧41蝣
& S; y3 Z, W8 t' V4 b瘜冽:
: u9 X/ r) v; I憒撣唾憭芸,臭誑啣憿閮剖蝣,粹閮剖蝣 SET PASSWORD FOR 芷撠亙蝣,銝 old_passwords=0 撠撖蝣潮敶梢
===========================================================================
- B  B) q, {  J: n鄉ysql蝝 8.0.21,php逅ysql箇2銵errors:. O; S- U, V! \1 C
mysqli_real_connect(): Server sent charset (255) unknown to the client. Please, report to the developers$ |) t; U4 U0 E3 N5 [3 l& M
mysqli_real_connect(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers4 _5 d% Y, `5 l3 B8 Y
:
; |  B0 k( Q) X" I
決ySQL 8.0.21銝哨caching_sha2_password舫隤頨思遢撽霅隞塚銝臭誑敺mysql_native_password隞亙php銝詨捆臭誑蝝php嚗銋臭誑靽格遍ySQL蝵柴 曆犖瘙箏靽格遍ySQL蝵:& Y9 x, D+ K# F6 t. R
vi /etc/my.cnf  乩:
0 R9 V4 z" ?0 E[mysqld]
+ h: A( |  h4 _
9 ]% [* ]- f% T9 i+ ycharacter-set-server=utf86 d0 |& ^9 L4 n& W% A
default_authentication_plugin=mysql_native_password8 F1 m1 u/ a! ^' x* Y
+ u' v/ G  v6 [2 ]
[mysql]
1 D6 \6 J1 r( cdefault-character-set=utf83 ?, O* {& c+ A- }7 V
! W& p0 z& j# D2 O0 C, D/ d4 d
[client]# R0 k) Q. s! p
default-character-set=utf8
, [! [3 R; D8 a3 H, o! d$ P) S6 s, l6 O) ^' {  D) |+ y" r
嗅mysqld
) k: {4 n- U( b4 U) e/ t  ?service mysqld restart
) g( k) ]: E( c' J) d+ M# U7 s摰!!
9 C& w+ R& G8 t; H3 u% f; ^/ n2 |
! d0 o3 d  f" u- K; a' H& Q

  B$ F, T8 w# w9 \, J1 q( I

雿輻券

祉蝛閬

BT蝳

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

QQ|撠暺撅||52AV璈A

GMT+8, 2024-11-21 21:29 , Processed in 0.058539 second(s), 16 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵