MySQL 严格模式引起的问题
MySQL About 640 words错误信息
Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre
SQL MODE
select @@sql_mode;
select @@global.sql_mode
输出:
ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
解决办法
去掉ONLY_FULL_GROUP_BY
- 方法一:
SQL
中修改(重启后失效)
set @@global.sql_mode =’STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION’;
- 方法二:在
my.ini
或my.cnf
中的[mysqld]
下配置(需重启)sql_mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
Views: 1,668 · Posted: 2019-04-07
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb/LiteNote扫描下方二维码关注公众号和小程序↓↓↓
Loading...