MySQL 表数据类型更改
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6148979/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Table Data Type Alter
提问by swapnesh
I created a table named items and inserted name as int and provided the length as 255 type by mistake but now i wanted to alter the table structure and run the query as--
我创建了一个名为 items 的表并将名称插入为 int 并错误地提供了 255 类型的长度,但现在我想改变表结构并运行查询——
ALTER TABLE items ALTER COLUMN name varchar(255); but it is not altering the table what i need to change in the table.help plz
ALTER TABLE 项目 ALTER COLUMN name varchar(255); 但这并没有改变我需要在 table.help 中更改的表格
回答by diEcho
回答by neocanable
try:
尝试:
alter table t1 modify column name varchar(255);
回答by royrui
Try:
尝试:
ALTER table items
MODIFY name varchar(255);