1.由于sql_mode 中设置no_zero_in_date 导致的错误
Executing:
CREATE TABLE `miaosha`.`new_table` (
`id` INT NOT NULL AUTO_INCREMENT,
`promo_name` VARCHAR(45) NOT NULL DEFAULT '',
`start_date` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`item_id` INT NOT NULL DEFAULT 0,
`promo_item_price` DOUBLE NOT NULL DEFAULT 0,
PRIMARY KEY (`id`));
Operation failed: There was an error while applying the SQL script to the database.
ERROR 1067: Invalid default value for 'start_date'
在终端连接mysql后,输入命令
select @@sql_mode;
正是红圈导致出错
mysql 8.0.20中一旦修改my.ini文件,就需要重新新建mysql服务
以下参考https://www