mysql - sql_mode being given finishing

 1, the use of group by group statement in mysql 5.7 or later, if you select the field, not exactly correspond to the group by the back of the field, there are other fields, it will report this error

ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column

View sql_mode 

select @@sql_mode;

mysql> select @@sql_mode;

You can see there is a ONLY_FULL_GROUP_BY, this is the strict control group by and select fields, without changing the sql statement premise, this can be removed

set @@ global.sql_mode = 'other values';

 

 

2、Mysql ERROR 1067: Invalid default value for ‘date’ 解决

If you specified when you create table engine entry is not supported at this time will support mysql error

 Sql_mode modify the value, if not add NO_ENGINE_SUBSTITUTION

set @@ global.sql_mode = 'original value, NO_ENGINE_SUBSTITUTION';

 

3, given data insertion Incorrect integer value: '' for column

mysql version to more than 5 will encounter this problem, insert null characters to use NULL

Default sql-mode = "STRICT_TRANS_TABLES, NO_AUTO_CREATE_USER   , NO_ENGINE_SUBSTITUTION",

after it is modified to sql-mode = "NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION ", to restart mysql

 

Other values ​​Description of sql_mode: https: //blog.csdn.net/wyzxg/article/details/8787878

Guess you like

Origin www.cnblogs.com/f-rt/p/11141424.html