更新,在stackoverflow上找到了8.0.13版本的解决方案:链接
8.0.13版本的
5.7版本解决方案
经过查看官网,发现5.7版本:链接
With one exception, the default value specified in a DEFAULT clause must be a literal 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 asNOW()orCURRENT_DATE. The exception is that, forTIMESTAMPandDATETIMEcolumns, you can specifyCURRENT_TIMESTAMPas the default. SeeSection 11.2.6, “Automatic Initialization and Updating for TIMESTAMP and DATETIME”.
创建表的时候,想为DATE类型设定默认值当前日期。发现一直报错,百度没有什么好办法。