当前位置:网站首页>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='用户表';
成功创建
边栏推荐
- Huawei HECs ECS is used to build a telegraf+influxdb+grafana monitoring system [Huawei cloud to jianzhiyuan]
- How to quickly compress the size of video?
- C # set the cursor shape of forms and systems
- tampermonkey这玩意如何替换flash播放器为h5播放器?
- Why does each running Department display that the database already exists, delete the database, and then succeed? Each running department must delete the database, and re run the whole successfully
- Terraformer importing cloud resources
- 2022.2.26 library management system 2 - module 2: reader management system
- vim二次替换
- Introduction to reverse learning - excellent assembly debugging tool OllyDbg
- Energy storage operation and configuration analysis of high proportion wind power system (realized by Matlab)
猜你喜欢

Operating instructions for communication between RS485 (Modbus RTU) industrial RFID reader ck-fr03-a01 and PLC Mitsubishi fx5u

使用cpolar远程办公(1)

JSP实现银柜台业务绩效考核系统

Learning notes of yolov3: model structure of yolov3

为什么每运行一部都显示一次数据库已存在,都要删除数据库,然后才能成功,每运行一部都要删除一次数据库,重新运行整体才成功.

LNMP deployment

Work summary: it took a long time to write SQL because of Cartesian product problem (Cartesian product summary attached)

强大的全文本搜索工具——AnyTXT Searcher

.NET C#基础(6):命名空间 - 有名字的作用域

Powerful full text search tool anytxt searcher
随机推荐
My struggle: my years in foreign enterprises (1)
应用编排Nomad与Kubernetes对比
cadence SPB17.4 - allegro - allegro_free_viewer
BS-XX-007基于JSP实现户籍管理系统
解决循环依赖BUG。Relying upon circular references is discouraged and they are prohibited by default.
Variable parameter expression
cadence SPB17.4 - group operation(add to group, view group list, delete group)
Please, don't use enumeration types in external interfaces any more!
Ali talked about the use of strategic mode in the project
小米9线刷ROM
Alibaba Cloud 3 (Soaring Falcon) x86_64(Py3.7.8) 系统 YUM源
AGV robot RFID sensor ck-g06a and Siemens 1200plc Application Manual
.NET C#基础(6):命名空间 - 有名字的作用域
2022.2.26 library management system 2 - module 2: reader management system
Single table query of SQL data query
Energy storage operation and configuration analysis of high proportion wind power system (realized by Matlab)
Optimal dispatching (thermal power, wind and energy storage) (realized by Matlab)
Stochastic dynamic economic dispatching model of wind power (realized by matlab code)
Hashicopy之nomad应用编排方案07(提交Job)
Terraformer导入云上资源