(1)
! d: F9 Y0 ?' D9 [- Mphp逅ysql箇2銵errors : (discuz蝬脤箇曄舫亙逅ysql航炊銵冽,芾撖思駁叮ysqlphp蝔撘靘皜祈岫)
S B" W# D7 ~& q; {! U9 z Q/ B! A5 l) ~5 n6 j- z9 R2 t3 v* w1 G
mysqli_real_connect(): Server sent charset (255) unknown to the client. Please, report to the developers
% G; f( J1 I4 y, x* ]5 X, `mysqli_real_connect(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers/ I" v- |) r8 d' s$ I$ I* H- h
:$ g+ ~8 T* O/ ]! N( y
決ySQL 8.0.21銝哨caching_sha2_password舫隤頨思遢撽霅隞塚銝臭誑敺mysql_native_password隞亙php銝詨捆臭誑蝝php嚗銋臭誑靽格遍ySQL蝵柴 曆犖瘙箏靽格遍ySQL蝵:
% @. u1 V4 U, d( Avi /etc/my.cnf 乩:( m. m$ D2 B; w- H* C D6 x
[mysqld]
3 D* \1 Q4 ?* t8 s
1 Q; ?0 T3 Y1 mcharacter-set-server=utf8( I+ D; o" y3 F& ^" z$ h
default_authentication_plugin=mysql_native_password
2 C$ G6 g5 M$ r5 Xvalidate_password.policy=LOW
' g# ~1 d# d% R# n[mysql]
7 G0 ^& V8 ?' Tdefault-character-set=utf8% F/ U! N1 r/ O+ X3 Z
3 C$ S5 r( n/ u6 v, S7 s[client]
& t p) Z& R% x8 J& ?8 F' `9 v3 ]default-character-set=utf85 ^ O+ C: x+ R+ j: t4 M
/ o' c1 d0 M4 S嗅mysqld9 v: q# D- e. r8 N
service mysqld restart
6 G' W! I3 ]2 j: t! ^6 n$ q
2 u0 ^/ @& V5 @4 f敺航賡銝雿:
( O; c' v" \2 l) X1 |mysql -u roor -p 0 a" P* L% _7 [% L( d6 x
SHOW VARIABLES LIKE 'validate_password%';
% I7 ~9 \& J+ ~; @; A' J. A% ISET GLOBAL validate_password_policy=LOW;ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '雿撖蝣';摰!!3 F0 z7 x; n' x
, s; U- G: V L# C0 k; k3 p7 d2 i閮: mysqld,/var/log/mysql/mysqld.log蝝:閮: 臭誑撖急皰hp蝔撘隞交葫閰 ~~~
. ]7 ]- f! d" Z1 w- <?
5 k8 h, I3 l; }( C% n2 V C - $hostname = "x.x.x.x";
. `0 O3 l! r9 x9 n, [" H - $database = "db_name";
: Z5 ^, J' m0 J3 l; ~: K - $username = "user_name";) y. R5 g1 o) W- O5 \8 P+ M+ s; ?
- $password = "pwd";. P7 _9 c7 P D" a9 E
' N& R6 k: t; Z3 c' c; R- $conn = mysqli_connect($hostname, $username, $password,$database) or trigger_error(mysql_error(),E_USER_ERROR);
. A- x" u7 b4 H; g: ` - mysqli_query($conn ,"SET NAMES utf8"); r. i) X" x- }) Y4 w1 T- w
- 2 ^4 j) C/ V5 \
- $sql = "select count(*) as total from " . "table_name";
* s0 Y2 T: H6 J% y' e9 Z+ ^0 ` - $rec = mysqli_fetch_assoc(mysqli_query( $conn,$sql));0 t6 o' d! G7 _) x+ Z- |- L
- echo $rec['total'];/ P. c. n+ r2 \1 b a2 N
- mysqli_close($conn);6 Q9 Z2 w" v1 A" e) ~& l
- ?>
銴鋆賭誨蝣摰g砍梯批捆閬蝛擃 999999999999 舐閬踝函嗅蝛 0
& V0 O5 J. ^2 g5 y* u. X& _
4 {7 b7 O0 E' z8 R5 @9 V" P7 D) c, G k* I4 N( U. n
酥hp 7.2.24 connect to mysql server,箇 : - PHP Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in /test/connectmysql8.php:9
/ m: N$ E _, i! d- y - Stack trace:4 d$ \( z/ b7 }2 C& i' `% Z
- #0 {main}
3 @: H! ?' A% m2 Y' r. V4 M# ? - thrown in /test/connectmysql8.php on line 9
- Y2 v1 B/ g" Y3 X+ i5 d8 N
5 x; l2 l3 d! t- Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in /test/connectmysql8.php:99 h1 C' q5 d9 d$ u: C2 W5 `8 ?
- Stack trace:
. w1 G7 Y! n& n" u7 o G9 l - #0 {main}2 B& C5 h$ }: E! c* L
- thrown in /test/connectmysql8.php on line 9
銴鋆賭誨蝣 舐祉訾憿,芾 yum install php-mysqlnd yum install php-mysqli 喳. e# _) e. j3 b G/ l1 ^, T
. Z6 E: G* h( n, d
/ y0 S: v9 M/ \7 h& Z' {[Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
i( Z! M5 d" v! _- P1 n隤芣: 砌賜批撱箄降"UTF8MB4",血⊥/ P3 S2 E2 k" E$ s% x
H. j. h0 C" b$ j9 t$ E3 j6 u
(2)
. M. w* \7 o+ y& A# f; j4 b- F: B(1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'system>0' at line 1
1 U4 ^6 f" X* A8 }SELECT COUNT(*) FROM common_usergroup WHERE type='special' and system>0
0 ~. _$ d) g* r7 m h$ v U4 w; e# n. s; K
(1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'groups = '' AND starttime<=1532077291 AND (endtime>=1532077291 OR endtime=0) ORD' at line 1& _2 r- u+ n5 a; S# s+ s1 D2 v# E
SELECT * FROM forum_announcement WHERE type!=2 AND groups = '' AND starttime<=1532077291 AND (endtime>=1532077291 OR endtime=0) ORDER BY displayorder, starttime DESC, id DESC LIMIT 1
; V3 y& Z) o4 s$ B, r4 t# b/ A. t
+ p0 @/ N; i& {: s8 q+ n' D5 |! c撤ySQL 8.0+撠systemgroups雿箔萄嚗隞乩賜湔亙沒QL銝剖systemgroups拙閰雿箸豢摨怒豢銵具豢銵典畾萎葉隞餅銝蝔桐蝙剁憒豢摨怠豢銵典豢銵典畾萄雿輻其systemgroups雿箏摮嚗敹雿輻其撠撘撘刻絲靘撖思`system``groups`
. u1 j# D i. N5 h5 d$ W* q
/ z: X- s$ ~$ t+ y3 [蝚砌航炊閬曉蚤iscuz!桅銝剔source\class\table\table_common_usergroup.php嚗
& c- b1 D' U) n8 p7 [撠隞嗡葉system券冽寞`system`嚗靽摮敺唬喳唳函詨桅喳胯
0 U* H$ R+ v8 E0 m( K: y1 G" X/ _* \8 f/ J- e9 t
蝚砌航炊閬曉蚤iscuz!桅銝銝剔source\class\table\table_forum_announcement.php嚗
# b' I6 A, S$ ^6 ^9 e& V- V' W" ]撠隞嗡葉groups券冽寧槁groups`嚗靽摮敺唬喳唳函詨桅喳胯7 T. c8 b" [9 h- I, R! B
8 d6 y& g; I% i6 P
憒決ySQL 8+啣銝摰鋆Discuz!嚗典鋆閬蝯夷nstall\data\install.sql隞嗡葉瘝撘system銝瘛餃銝撠撘靽摮唬喳唳函詨桅嚗血銋箇鋤QL隤瘜航炊1 D* _7 S0 i0 H4 y# N7 K. [( M
7 M) F- |. T; ~4 w, c, S, X
箔踹隤瘜航炊嚗典神SQL隤交嚗銝摰閬箸豢摨怠豢銵典豢銵典畾萄券冽溶銝撠撘嚗Discuz!璅撖急臬銝憒亦
% d ?% {5 l H隞乩: 蝝 MySQL 8.0+ 敺Discuz! 湔啁楨摮箇鋤QL隤瘜航炊
. Y' L5 X4 Y+ H7 I
, ]: A# J) G9 ]+ w7 x9 P- I( Z! \ x3 w* U
8 F" C! R, H" J( ^$ g# S3 B. p- g. C5 m
|
|