mysql 升级到5.7后,sql_mode 是下面的值,
MySQL [zencart]> show variables like "%sql_mode%";
+---------------+------------------------------------------------------------------------------------------------------------------------+
| Variable_name | Value |
+---------------+------------------------------------------------------------------------------------------------------------------------+
| sql_mode | STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+---------------+------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)
如果程序出现报错,又不想修改程序,可临时将其设置成 空
set global sql_mode='';
想要永久生效,可写在配置文件中 my.cnf
sql_mode=''
网友评论