您的位置:首页 > 数据库 > MySQL

mysql 追加update_time、create_time、id三字段

2017-11-26 13:20 1141 查看

紧当数据创建时设置值

alter table tbl_books modify create_time datetime  not null default current_timestamp


当数据被修改时该字段自动更新

alter table tableName add update_time datetime not null default current_timestamp on update current_timestamp


修改主键自动增加

alter table tbl_books modify id bigint auto_increment
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  mysql