Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 1.61 KB

坑.md

File metadata and controls

28 lines (20 loc) · 1.61 KB

  1. 导入mysql出错 DROP TABLE IF EXISTS tb_seckill_voucher; CREATE TABLE tb_seckill_voucher ( voucher_id bigint(20) UNSIGNED NOT NULL COMMENT '关联的优惠券的id', stock int(8) NOT NULL COMMENT '库存', create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', begin_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '生效时间', end_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '失效时间', update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', PRIMARY KEY (voucher_id) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '秒杀优惠券表,与优惠券是一对一关系' ROW_FORMAT = Compact;

[42000][1067] Invalid default value for 'begin_time'

​ 由于不能直接添加时间的默认值为0

在"D:\MysqlData\MySQL\MySQL Server 8.0\my.ini" 路径下修改ini文件 在[mysqld]下面添加如下列:

sql_mode=ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

image-20240319203313131

  1. 端口被占

netstat -ano | findstr "LISTENING" 检查监听状态的端口,以确定是否有其他进程正在监听8081的子端口。