mysql global.sql_mode 采坑之路 解决

时间:2024-10-30 12:12:00

 报错:#4 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'ws.t_sys_cat.ARG1' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

或者   Err 1067   invalid default value for ‘crt_tm’ 等等之类的问题

大都问题都在于mysql5.7 版本中有了一个select mode(严格模式)最简单的方法就是设置sql_mode为空

首先查询:

select @@sql_mode; 

sql_mode中有很多

运行以下设置空

set @@global.sql_mode ='';

flush privileges; 

然后,在查询一下报错的sql语句就发现可以了!!!