当前位置:网站首页>mysql创建表出错1067 - Invalid default value for ‘update_time‘
mysql创建表出错1067 - Invalid default value for ‘update_time‘
2022-06-11 14:03:00 【GoLang.fmt】
报错信息:
1067 - Invalid default value for 'update_time'
解决办法:
timestamp必须给个默认值,才能创建成功。
CREATE TABLE `user` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(20) NOT NULL DEFAULT '' COMMENT '姓名',
`email` varchar(30) NOT NULL DEFAULT '' COMMENT '邮箱',
`is_admin` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否是超级管理员 1表示是 0 表示不是',
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态 1:有效 0:无效',
`updated_time` timestamp NOT NULL DEFAULT '1970-01-01 10:00:00 ' COMMENT '最后一次更新时间',
`created_time` timestamp NOT NULL DEFAULT '1970-01-01 11:00:00 ' COMMENT '插入时间',
PRIMARY KEY (`id`),
KEY `idx_email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户表';
成功创建
边栏推荐
- JDBC connection pool is used for batch import. 5million data are run each time, but various problems will occur in the middle
- Container -- reverse content -- use of explosion, splicing, and inversion functions
- Terraformer importing cloud resources
- Installation and use of Anaconda
- 2022.2.27 library management system 3 - book borrowing and returning registration module
- Two small things, feel the gap with the great God
- /usr/bin/gzip: 1: ELF : not found /usr/bin/gzip: 3: : not found /usr/bin/gzip: 4: Syntax erro
- couldn‘t upgrade db schema: insert into ACT_GE_PROPERTY values (‘common.sche[已解决]
- JSTL 自定义标签
- About PHP: the original deployment environment written by PHP is deployed in phpstudy, PHP + MySQL + Apache. However, the computer must be turned on every time
猜你喜欢

Ecplise cannot connect to SQL Server

Vi LXD deployment of lab server for development records

airtest自动化测试

cadence SPB17.4 - allegro - allegro_ free_ viewer

【公开课预告】:MXPlayer OTT音视频转码实践和优化

cadence SPB17.4 - group operation(add to group, view group list, delete group)

Unsealing easy QF PDA helps enterprises improve ERP management

Distributed file system and enterprise application -- elk enterprise log analysis system

AGV robot RFID sensor ck-g06a and Siemens 1200plc Application Manual

Easyexcel configuration and Application
随机推荐
SQL数据查询之单表查询
2022工具钳工(中级)操作证考试题库及答案
Kubernetes binary installation (v1.20.15) (VI) deploying worknode nodes
六.开发记录之实验室服务器LXD部署
Redis uses 10 tips, please accept!
Ecplise cannot connect to SQL Server
d区间到可空转换
Application choreography nomad vs. kubernetes
The application of machine learning in database cardinality estimation
Implementation of VGA protocol based on FPGA
Invalid bound statement (not found) error [resolved]
基于FPGA的VGA协议实现
create_ Error in engine MySQL connector encryption method
Just after the college entrance examination, I was confused and didn't know what to do? Tell me what I think
折叠表达式
复选框 全选or取消全选
BS-XX-007基于JSP实现户籍管理系统
.NET C#基础(6):命名空间 - 有名字的作用域
Checkout design in SAP Spartacus
[Clickhouse] the clckhouse view can be inserted but not queried