(1)
* b) I: ?) Z' T% m5 f8 zphp逅ysql箇2銵errors : (discuz蝬脤箇曄舫亙逅ysql航炊銵冽,芾撖思駁叮ysqlphp蝔撘靘皜祈岫)
6 s. v4 Y& W- A
+ [2 Y5 T: V) F, _5 ]mysqli_real_connect(): Server sent charset (255) unknown to the client. Please, report to the developers
7 \' B% J/ ]6 Smysqli_real_connect(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers
6 ?9 t1 s. }$ i3 R: [ }, y7 @2 j3 N
決ySQL 8.0.21銝哨caching_sha2_password舫隤頨思遢撽霅隞塚銝臭誑敺mysql_native_password隞亙php銝詨捆臭誑蝝php嚗銋臭誑靽格遍ySQL蝵柴 曆犖瘙箏靽格遍ySQL蝵:
5 t9 M% @5 t8 n& fvi /etc/my.cnf 乩:
3 z; f5 o R$ F# M0 ~[mysqld]; F1 C$ a/ E. X* b4 K
p( \: E: @, k! n
character-set-server=utf8
# Y" {+ {. f3 ^default_authentication_plugin=mysql_native_password- F+ ~* \0 `8 \" Q9 b- {* G7 N
validate_password.policy=LOW
0 B0 ]3 x2 ~4 e! t! ~[mysql]
/ c4 z% u) N& H8 C0 Adefault-character-set=utf8+ @* c- h2 X S- `. _
: E/ v& r0 W$ B7 @% m$ @
[client]
: `# O% C+ O% D+ F2 N( Odefault-character-set=utf8" R3 U, g; |# i! L
# {' P8 E) i- w
嗅mysqld8 A- Y1 T, Y4 ?4 X# W; d' e
service mysqld restart# }8 n+ ?% B( `$ S- k5 f7 W
5 E( o& b5 e9 @- A A敺航賡銝雿:
* [: M0 h/ y/ A* R5 Tmysql -u roor -p , s$ d W6 N7 z9 B
SHOW VARIABLES LIKE 'validate_password%';" [" A+ F# y H+ Z' e% w5 n# J
SET GLOBAL validate_password_policy=LOW;ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '雿撖蝣';摰!!, e, u9 q$ E0 {' u" d g
! h/ \( q8 h- k V7 r( Z閮: mysqld,/var/log/mysql/mysqld.log蝝:閮: 臭誑撖急皰hp蝔撘隞交葫閰 ~~~
- `7 l `6 j" q$ O6 }5 i) K" G; }- <?
8 ~! c" Z- i1 D1 \: h" ` - $hostname = "x.x.x.x";. V9 U& J; b' b0 \) F
- $database = "db_name";3 h1 k A8 @+ r" L* V
- $username = "user_name";
7 e, g# z4 n$ C' ]1 W - $password = "pwd";* c0 A8 R% u" k) x7 t( p
+ O7 t9 }4 n: u' N# \, X6 ?' D- $conn = mysqli_connect($hostname, $username, $password,$database) or trigger_error(mysql_error(),E_USER_ERROR);; j, v) E8 i. A2 `1 h8 P4 z
- mysqli_query($conn ,"SET NAMES utf8");* u1 r; R7 v6 Z/ v3 Q
/ F7 u2 L: ~9 e% [# x) i7 ~- $sql = "select count(*) as total from " . "table_name";9 b* N4 W+ A! P1 U
- $rec = mysqli_fetch_assoc(mysqli_query( $conn,$sql));. E: v0 r* B" U6 q. L; c5 {) X8 b8 g
- echo $rec['total'];7 ` ]7 g8 E1 T3 q, m9 p; S. b
- mysqli_close($conn);6 P' I" I2 P c }2 W
- ?>
銴鋆賭誨蝣摰g砍梯批捆閬蝛擃 999999999999 舐閬踝函嗅蝛 0
: O, G( h' ^+ E& q& @6 T
! z# Y- I8 C+ X6 l; p3 L. ?1 E6 p# H1 N$ }2 E; r" m7 d. ~" s
酥hp 7.2.24 connect to mysql server,箇 : - PHP Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in /test/connectmysql8.php:9+ ?0 J9 _0 R5 R8 o
- Stack trace:( h3 d4 P' \" S3 h8 `. [% L U$ M
- #0 {main}
- Q' }0 }1 X; D# s, M - thrown in /test/connectmysql8.php on line 9
1 v+ J7 I. Y: l: v - % ^8 k# f9 H8 t
- Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in /test/connectmysql8.php:91 P; u, Y, w3 @7 ^
- Stack trace:
( w5 g: D' \6 M( y+ w C' q - #0 {main}, o& ]* a7 L; \# K
- thrown in /test/connectmysql8.php on line 9
銴鋆賭誨蝣 舐祉訾憿,芾 yum install php-mysqlnd yum install php-mysqli 喳3 O) q; E2 h. J" b7 |1 B9 J0 t
# O+ v& E0 P. M# G+ c2 |
! S: ^, E2 A- {3 e0 I4 I[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.# }" Q6 }" e" y; ^7 S7 @
隤芣: 砌賜批撱箄降"UTF8MB4",血⊥
7 l6 `7 b$ Q* T8 R9 c1 p$ x
/ J5 X. \" j& ^5 k2 b(2) Y5 e m( C) P" q* _
(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 12 D. `/ I/ r- t( [* d4 j5 z
SELECT COUNT(*) FROM common_usergroup WHERE type='special' and system>0/ v, b0 q' }* {) {/ R1 p' h
/ p8 }( h6 W0 F3 V( q4 B6 ?(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/ B) {* _0 r# `
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
4 {# @0 u, l' w: @
8 H3 [# S3 V3 T$ J+ ^; u撤ySQL 8.0+撠systemgroups雿箔萄嚗隞乩賜湔亙沒QL銝剖systemgroups拙閰雿箸豢摨怒豢銵具豢銵典畾萎葉隞餅銝蝔桐蝙剁憒豢摨怠豢銵典豢銵典畾萄雿輻其systemgroups雿箏摮嚗敹雿輻其撠撘撘刻絲靘撖思`system``groups`
' a! }3 Y+ X6 }0 E8 A+ |( K6 A( a! D$ m( ]3 A
蝚砌航炊閬曉蚤iscuz!桅銝剔source\class\table\table_common_usergroup.php嚗7 v9 T: L. u" g1 v$ ?! ]. ?' k
撠隞嗡葉system券冽寞`system`嚗靽摮敺唬喳唳函詨桅喳胯
1 z% a( K- i R* x p' W$ h( A; W; z
蝚砌航炊閬曉蚤iscuz!桅銝銝剔source\class\table\table_forum_announcement.php嚗
& ~: C) M- J( I/ }1 S. a9 L撠隞嗡葉groups券冽寧槁groups`嚗靽摮敺唬喳唳函詨桅喳胯
8 j( X8 C1 x3 |1 C E; b$ k% v2 k% S
憒決ySQL 8+啣銝摰鋆Discuz!嚗典鋆閬蝯夷nstall\data\install.sql隞嗡葉瘝撘system銝瘛餃銝撠撘靽摮唬喳唳函詨桅嚗血銋箇鋤QL隤瘜航炊
9 S6 j7 e5 U3 R$ W8 W2 t
+ f5 u8 r8 A6 p箔踹隤瘜航炊嚗典神SQL隤交嚗銝摰閬箸豢摨怠豢銵典豢銵典畾萄券冽溶銝撠撘嚗Discuz!璅撖急臬銝憒亦% C$ F6 p, z3 y" Y x7 J
隞乩: 蝝 MySQL 8.0+ 敺Discuz! 湔啁楨摮箇鋤QL隤瘜航炊2 @4 r/ Z7 E4 e- s, f: c4 {/ q
" [: |3 A2 L# {) K# q8 z$ \$ Z
+ H3 m. \3 \1 d0 {
( v1 K2 K( ~& M" Z$ ?* B* F& k: K% K3 ~; _2 N
|
|