mysql ddl 失败_在mysql中设置列默认值失败

这是我的桌子DDL:-- auto-generated definition

create table treehole

(

id bigint auto_increment

primary key,

content text not null,

author_id bigint not null,

create_time timestamp default CURRENT_TIMESTAMP not null,

modify_time timestamp not null,

oo_num int default 0 not null,

xx_num int default 0 not null

);

create index Treehole_author_id_index

on treehole (author_id);

create index Treehole_create_time_index

on treehole (create_time desc);

create index Treehole_oo_num_index

on treehole (oo_num desc);

并且我想将modify_time的默认值设置为current_timestamp:alter table `treehole`

alter column `modify_time`

set default current_timestamp;

它会发生:[42000][1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_timestamp' at line 3

我的MySQL版本是8.0.422

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值