一、修改Mysql 字段类型
alter table t_orm_timerorm modify column t_name varchar(255);
二、修改mysql字段为自增字段
create table t_orm_timerorm(
id bigint primary key,
t_name varchar(255)
}
--需要定义自增键为一个主键
alter table t_orm_timerorm modify id bigint auto_increment ;
否则会出现如下错误:(具体为什么还未查出)
1075. Incorrect table definition;
there can be only one auto column and it must be defined as a key
本文详细介绍了如何在MySQL中修改字段类型及如何将字段设置为自增键,包括具体语法和常见错误处理。
1435

被折叠的 条评论
为什么被折叠?



