时间:2021-07-01 10:21:17 帮助过:28人阅读
注意updateTime字段,会在创建的时候报错:
[Err] 1067 - Invalid default value for ‘updateTime‘
查找了原因,是要设置sql_mode
查看MySQL的sql_mode配置:
mysql> show variables like ‘sql_mode‘; +---------------+-------------------------------------------------------------------------------------------------------------------------------------------+ | Variable_name | Value | +---------------+-------------------------------------------------------------------------------------------------------------------------------------------+ | 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 | +---------------+-------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set, 1 warning (0.00 sec)
将mysql安装文件里面的my-default.ini(windows)//etc/my.cnf(Linux)里面添加设置:
sql_mode=ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
http://www.nowck.com/archives/70.html
http://blog.csdn.net/wyzxg/article/details/8787878
MySQL sql_mode设置
标签:default 配置 csdn int www. comment 查看 engine 概率