Invalid default value for 'Date'

后端 未结 5 838
太阳男子
太阳男子 2021-01-02 17:56

I want to set date as default value for date in mysql (not timestamp), but the following error appear

ALTER TABLE `RMS`.`transactionentry` 
CHANGE `Date` `Da         


        
5条回答
  •  执念已碎
    2021-01-02 18:12

    The DEFAULT value clause in a data type specification indicates a default value for a column. With one exception, the default value must be a constant; it cannot be a function or an expression. This means, for example, that you cannot set the default for a date column to be the value of a function such as NOW() or CURRENT_DATE. The exception is that you can specify CURRENT_TIMESTAMP as the default for a TIMESTAMP column.

    For Detail: Refer dev.mysql.com

提交回复
热议问题