52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
     
亦: 5019|敺: 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').. s! c* R8 Y4 T  X% @7 P7 A" C

* c0 Y* p  ^, P2 Z) U/ i臬歉hp 5.3隞亙撖蝣潭16雿蝺函Ⅳ,啁php 5.3隞亙41雿蝺函Ⅳ,mysql 5.2 隞亙閮凋16蝣,隞交甇斤車航炊.& i4 a! e  M1 u! e3 L. X
閮箸瑚銝mysql: (php 5.6.38 , mysql 5.1.73)/ J, [! G( \' {! s" V, O5 A; F% f
餃叮ysql 嗅頛詨 :
' @% t! U7 I  ?2 P. L, H) Y3 ~mysql> SHOW VARIABLES LIKE 'old_passwords';* i# O- I) N) u$ a' A4 A
+------------------+-------+& g& I8 d. |6 `$ H8 n5 ?- d
| Variable_name | Value |. E/ i+ B1 X# r( ~
+------------------+-------+
$ ?+ {1 d2 S5 M% C, U| old_passwords | ON   |
5 s3 F, k( e' W* e9 M  C% X/ G1 d+------------------+-------+
& P! X8 @. D2 {1 row in set (0.00 sec)
) j- P& S' m' Q/ w' T' R
, u7 p5 }% N* B0 n/ T" {old_password  ==> ON  撠梯”蝷 /etc/my.cnf  鋆 old_passwords=1  閮剖16蝣,撠摰閮剔 0 嗅mysqld ==> service mysqld restart
% j8 W; Y) I- y8 E- V mysql prompt銝頛詨:
( T* a1 O6 {; T. }+ `mysql> SET old_passwords=FALSE;  # o' i1 N4 X, Y0 V& E
瑼X叮ysql.user 瘥撖蝣潮瑕漲:
# W2 q! ~8 H; e2 a0 w( Dmysql> SELECT 'User', 'Host', Length('Password') FROM mysql.user;; W3 t7 T9 m/ i& C, |/ U, |. ]
憒瘝寞41雿,Length('Password')甈雿閰脤賣160(銵函內瘝閮剖蝣) 8 t5 v. s( h* y: }, H. c5 |  F

: ?7 s8 ?% S8 O$ x0 p閮剖靘撖蝣:
6 i! o2 _  R9 a& [/ [  hmysql> SET PASSWORD FOR 'root'@'192.168.1.1' = PASSWORD('靘撖蝣');    // 撠敹閬詨靘 撣唾@IP 湔,銝閬寥臭  N7 p' g/ x! [; u) Q
mysql> flush privileges;
- \; Y/ c0 O) I9 |
; n. W) e) u# K6 t. i6 {頛詨 SELECT 'User', 'Host', Length('Password') FROM mysql.user; 瑼X亙蝣澆漲,撠勗舐潛曉寧root 撖蝣潮瑕漲撌脫寧41蝣1 s7 G2 y! J9 R8 l4 u) K8 F
瘜冽:
+ e6 c0 O' [: d. K: U  O: t* T/ M憒撣唾憭芸,臭誑啣憿閮剖蝣,粹閮剖蝣 SET PASSWORD FOR 芷撠亙蝣,銝 old_passwords=0 撠撖蝣潮敶梢
===========================================================================
5 n% G+ \$ i8 G" I; {鄉ysql蝝 8.0.21,php逅ysql箇2銵errors:
1 O: W  {! t0 K( J) lmysqli_real_connect(): Server sent charset (255) unknown to the client. Please, report to the developers1 @& v) R) n6 \2 E6 \% I
mysqli_real_connect(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers
' O$ K; z* H% H2 Y0 [, Q:

: _. }- u% {: x& O$ T8 l# P決ySQL 8.0.21銝哨caching_sha2_password舫隤頨思遢撽霅隞塚銝臭誑敺mysql_native_password隞亙php銝詨捆臭誑蝝php嚗銋臭誑靽格遍ySQL蝵柴 曆犖瘙箏靽格遍ySQL蝵:9 L7 u5 y% T, F7 q
vi /etc/my.cnf  乩:
$ Q7 y& O2 k$ B! a( K[mysqld]9 d) Y/ r" C( u  C4 W* S

1 _$ E. I! W8 W/ p0 p/ j  Tcharacter-set-server=utf8
' |* X4 j3 x, b. Pdefault_authentication_plugin=mysql_native_password) F# Q1 }8 w; _5 @
$ U4 F: P" g9 g, K! W
[mysql]1 q9 S, s5 ?5 |+ ~, y! V
default-character-set=utf8
  w5 d7 G. |4 [! T8 J1 A
! Q$ q1 V5 i- q+ z. U7 w[client]
/ m1 }3 l6 B& L! P4 V( ?default-character-set=utf81 N6 S. j4 j5 O! `% [
( `/ @, }/ l! k" Z; {4 W
嗅mysqld7 H/ n$ F1 _$ g, e( s( ~) A
service mysqld restart
0 {3 `' z& T* \/ y; ^$ {摰!!: e- {5 E+ m; Y; o
, T8 n7 p& k3 z* B& H9 q; z2 ^
5 h* a* v; _% _/ Q1 d$ y" p; O# y

雿輻券

祉蝛閬

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

QQ|撠暺撅||52AV璈A

GMT+8, 2026-2-11 12:31 , Processed in 0.059732 second(s), 16 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵