[hide=d100000000000000000000,999999999999]於video1主機下 /test/connectmysql8.php[/hide] . D/ {; m; G0 ~2 H- e3 X' v/ L+ c: [% {- m$ M
$ r# [8 y" A2 X8 ~$ X當php 7.2.24 connect to mysql server,出現 :
PHP Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in /test/connectmysql8.php:9* _; W3 Y7 Z! Y6 F o2 O
Stack trace: 2 r& t# P/ d: |2 E
#0 {main}, n$ }9 F Z* V( C9 X
thrown in /test/connectmysql8.php on line 9 1 {6 @+ @" S) _+ V! B! p# F, Z w9 N) [6 H
# D* o5 w& }: s% z7 L3 G
Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in /test/connectmysql8.php:98 ]. _6 T4 [& }8 f) f# R1 \ x, ?0 i" F N; D
Stack trace: ) W s, z0 ^* b( ?0 k. d
#0 {main} \0 F) P, [1 M! r2 ?
thrown in /test/connectmysql8.php on line 9
複製代碼
這是版本相依的問題,只要 yum install php-mysqlnd 或 yum install php-mysqli 即可 ! b0 }! B) `9 F* H+ \; K / c: W* [4 X/ m , k+ _& k9 D: J# t; b5 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. ' \% d, S' e+ E1 }' S說明: 千萬不能照它建議用"UTF8MB4",否則無法成功啟動& S( \/ j9 ^( U) L
& @+ f$ F& Q9 [+ o(2), R- P; v4 V; {! 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- R1 m# h( u+ p# h" A
SELECT COUNT(*) FROM common_usergroup WHERE type='special' and system>0! x, w: T( _& T# k' U
) W+ b7 J8 X4 t0 V* h
(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/ a2 B% y" z/ t5 S0 F
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% z& n# h. ]9 r& a* N. T- D
4 e. j7 m" [7 l& l
因為MySQL 8.0+將system和groups作為了關鍵字,所以不能直接在SQL中將system和groups這兩個詞作為數據庫、數據表、數據表字段中的任意一種使用,如果數據庫名或數據表名或數據表字段名使用了system或groups作為名字,必須使用一對反引號引用起來。寫作`system`或`groups`。 . R/ P9 b, @5 Q' Y, f6 p% t4 H1 @) ]+ H1 `' Q z* W, M
第一個錯誤需要找到Discuz!目錄中的source\class\table\table_common_usergroup.php, ! k$ \* t; a& m5 L% H將文件中所有的system全部改成`system`,保存後重新上傳到服務器的相同目錄即可。+ C5 P4 X* ?/ A% ~