深圳全飞鸿

标题: mysql 表栏位 默认时间 [打印本页]

作者: zhgc    时间: 2019-6-29 13:02
标题: mysql 表栏位 默认时间
本帖最后由 zhgc 于 2019-6-29 13:14 编辑

方法一、是用alert table语句:

alter table  sfc.c_po_config_t modify  `TIME` timestamp  default current_timestamp


方法二、直接创建方便:


use test_db1;  

create table test_ta1(  

id mediumint(8) unsigned not nulll auto_increment,  

createtime timestamp not null default current_timestamp,  

primary key (id)  

)engine=innodb default charset=gbk;  





欢迎光临 深圳全飞鸿 (http://www.nagomes.com/disc/) Powered by Discuz! X3.2