How to change MySQL column definition?

后端 未结 3 533
清歌不尽
清歌不尽 2020-12-02 07:10

I have a mySQL table called test:

create table test(
    locationExpect varchar(120) NOT NULL;
);

I want to change the locationExpect colum

3条回答
  •  生来不讨喜
    2020-12-02 07:37

    Do you mean altering the table after it has been created? If so you need to use alter table, in particular:

    ALTER TABLE tablename MODIFY COLUMN new-column-definition

    e.g.

    ALTER TABLE test MODIFY COLUMN locationExpect VARCHAR(120);
    

提交回复
热议问题