MySQL doesn’t have a default value 的解决方法

查看sql_mode

mysql> show session variables like '%sql_mode%';

修改sql_mode, 把 STRICT_TRANS_TABLES 去掉

SET @@global.sql_mode ="ONLY_FULL_GROUP_BY,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION";