1.timestamp 类型

create table manager(
id int not null primary key,
mdate timestamp not null default current_timestamp
);
2.datetime 类型
create table manager(
id int not null primary key,
mdate datetime
);
1.timestamp 类型
create table manager(
id int not null primary key,
mdate timestamp not null default current_timestamp
);
2.datetime 类型
create table manager(
id int not null primary key,
mdate datetime
);
本文标题:《MySQL 创建表时,设置自动插入当前时间字段的两种格式》作者:极四维博客
原文链接:http://cway.top/post/105.html
特别注明外均为原创,转载请注明。
扫描二维码
可在微信查看或分享至朋友圈。
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。