如何更改MySQL列定义?
我有一个名为 test 的 mySQL 表:
create table test(
locationExpect varchar(120) NOT NULL;
);
我想将 locationExpect 列更改为:
create table test(
locationExpect varchar(120);
);
如何快速完成?
I have a mySQL table called test:
create table test(
locationExpect varchar(120) NOT NULL;
);
I want to change the locationExpect column to:
create table test(
locationExpect varchar(120);
);
How can it be done quickly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您的意思是在创建表后更改表吗?如果是这样,您需要使用 alter table,特别是:
例如
Do you mean altering the table after it has been created? If so you need to use alter table, in particular:
e.g.
MySql 中更改列名称的语法:
示例:
Syntax to change column name in MySql:
Example:
这应该可以做到:
This should do it: