52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
     
亦: 4895|敺: 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').( H. B) m, b7 p0 @6 X
- X' O1 W5 g  B2 h3 K. \2 _
臬歉hp 5.3隞亙撖蝣潭16雿蝺函Ⅳ,啁php 5.3隞亙41雿蝺函Ⅳ,mysql 5.2 隞亙閮凋16蝣,隞交甇斤車航炊.3 `: _; m5 J8 ^7 M* u  d; ^
閮箸瑚銝mysql: (php 5.6.38 , mysql 5.1.73)
/ T+ H* ^5 ]0 \0 A# R餃叮ysql 嗅頛詨 : 5 ?, n* J- ^8 @" J, g$ L1 u
mysql> SHOW VARIABLES LIKE 'old_passwords';
, |4 y2 R  w& i/ n1 s) n+------------------+-------+
% g4 j& N0 U6 R" _| Variable_name | Value |6 c" y: Z7 k: F. E  Q. Y
+------------------+-------+, `! a! K5 f7 W7 I9 i% E
| old_passwords | ON   |% h- q: e8 g; D& v9 m
+------------------+-------+
6 g2 ]1 D3 f' }1 row in set (0.00 sec)
; H, j% k; K4 Z- u- P
* E: G; R$ _- f7 R/ V; \old_password  ==> ON  撠梯”蝷 /etc/my.cnf  鋆 old_passwords=1  閮剖16蝣,撠摰閮剔 0 嗅mysqld ==> service mysqld restart+ D5 U7 E) o# W. [- C  |; J. G
mysql prompt銝頛詨:3 w! u7 x0 M& t+ l) Z* i
mysql> SET old_passwords=FALSE;  2 x" K" O2 |' d  @, c9 j) O
瑼X叮ysql.user 瘥撖蝣潮瑕漲:
* X$ K# M& i$ n. {# T4 R$ A. `6 Pmysql> SELECT 'User', 'Host', Length('Password') FROM mysql.user;
- Z) n' P  {, k; \憒瘝寞41雿,Length('Password')甈雿閰脤賣160(銵函內瘝閮剖蝣) 8 m9 B" e/ H$ c) o4 M- G5 s
/ R3 Q. j5 {2 r% C9 ^9 Q; e; f
閮剖靘撖蝣:
; z5 m% A+ }" w3 N2 }' F! Imysql> SET PASSWORD FOR 'root'@'192.168.1.1' = PASSWORD('靘撖蝣');    // 撠敹閬詨靘 撣唾@IP 湔,銝閬寥臭) a' o7 H3 M8 A* B+ D) S+ S
mysql> flush privileges;( G; Q- }; Y! h
5 Y% Y. T0 _0 w" ]1 P
頛詨 SELECT 'User', 'Host', Length('Password') FROM mysql.user; 瑼X亙蝣澆漲,撠勗舐潛曉寧root 撖蝣潮瑕漲撌脫寧41蝣
; r. f) I4 |* s6 `& \" E瘜冽:* z# D4 {0 U) b; r( s
憒撣唾憭芸,臭誑啣憿閮剖蝣,粹閮剖蝣 SET PASSWORD FOR 芷撠亙蝣,銝 old_passwords=0 撠撖蝣潮敶梢
===========================================================================
, V/ s4 x5 _5 P/ _鄉ysql蝝 8.0.21,php逅ysql箇2銵errors:$ n4 f/ a' h" c1 e# @9 n
mysqli_real_connect(): Server sent charset (255) unknown to the client. Please, report to the developers
2 j) k2 _4 J0 w! u  ~' k6 m9 |' Xmysqli_real_connect(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers
( K% _+ P5 k% F5 E: j' A:

4 a7 B6 p: @/ g. ?) K決ySQL 8.0.21銝哨caching_sha2_password舫隤頨思遢撽霅隞塚銝臭誑敺mysql_native_password隞亙php銝詨捆臭誑蝝php嚗銋臭誑靽格遍ySQL蝵柴 曆犖瘙箏靽格遍ySQL蝵:
9 V4 N8 `+ m9 a! }vi /etc/my.cnf  乩:
5 u$ T3 u3 @% m[mysqld]
# L. k- n4 u& l+ u
- C. J. }4 G" S4 @1 v( Gcharacter-set-server=utf8
4 Y% I7 T( v4 E  ]1 @9 Edefault_authentication_plugin=mysql_native_password3 V! h8 o2 J0 R, q5 l; v  Z7 _2 ?

5 u/ z0 P, T6 ?$ e0 S* K[mysql]7 ~: U4 m6 ?; z+ G& w! r' n' d# @
default-character-set=utf8
! A3 ~9 i1 b% K/ A2 @: h; e+ O
+ @2 F( ^9 i  h/ ^0 D0 s[client]
8 J4 I3 C0 ^2 e& E- H' Fdefault-character-set=utf88 A4 o% J5 i" `% U1 X4 W1 A7 Z
1 u) F$ U, d6 A2 |0 R' N
嗅mysqld
4 w) D# u. x1 Gservice mysqld restart0 s2 }# _) g/ J' F+ P0 A, N
摰!!
" Y% ]# s& B% m4 X. T* P1 q  g, X
3 s" s  R% d# m! p3 Y
: I) R) Y7 B2 }( O3 P0 M$ ~

雿輻券

祉蝛閬

撠蝝詨

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

QQ|撠暺撅||52AV璈A

GMT+8, 2025-12-6 01:15 , Processed in 0.060509 second(s), 16 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵