欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

mysql 字段操作

程序员文章站 2022-04-03 22:10:05
...

一、修改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