Invalid default value for 'create_date' timestamp field

后端 未结 16 1566
我寻月下人不归
我寻月下人不归 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:00

    To avoid this issue, you need to remove NO_ZERO_DATE from the mysql mode configuration.

    1. Go to 'phpmyadmin'.
    2. Once phpmyadmin is loaded up, click on the 'variables' tab.
    3. Search for 'sql mode'.
    4. Click on the Edit option and remove NO_ZERO_DATE (and its trailing comma) from the configuration.

    This is a very common issue in the local environment with wamp or xamp.

提交回复
热议问题