Invalid default value for 'create_date' timestamp field

后端 未结 16 1548
我寻月下人不归
我寻月下人不归 2020-11-30 16:49

I have the following sql create statement

mysql> CREATE  TABLE IF NOT EXISTS `erp`.`je_menus` (
    ->   `id` INT(11) NOT NULL AUTO_INCREMENT ,
    -&g         


        
16条回答
  •  情深已故
    2020-11-30 17:08

    To disable strict SQL mode

    Create disable_strict_mode.cnf file at /etc/mysql/conf.d/
    

    In the file, enter these two lines:

    [mysqld]
    sql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
    

    Finally, restart MySQL with this command:

    sudo service mysql restart
    

提交回复
热议问题