SQLSTATE[42000]: Syntax error or access violation

位置:首頁 / 新聞中心 / 知識教程

知識教程 Admin 2024-02-23 15:02:47 771
mysql在5.5版本下開發(fā)的項(xiàng)目放在mysql 5.7項(xiàng)目下報(bào)錯:
SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'kuguan.a.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

錯誤原因:
研究發(fā)現(xiàn),mysql 5.7 比5.5和5.6版本的數(shù)據(jù)模式更加嚴(yán)謹(jǐn)導(dǎo)致的錯誤

解決辦法:
需要在mysql 5.7下配置數(shù)據(jù)模式。
NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

以上就是“SQLSTATE[42000]: Syntax error or access violation”的詳細(xì)內(nèi)容,更多請關(guān)注木子天禾科技其它相關(guān)文章!

以上就是“SQLSTATE[42000]: Syntax error or access violation”的詳細(xì)內(nèi)容,更多請關(guān)注木子天禾科技其它相關(guān)文章!

15934152105 掃描微信