Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何增加char数据类型为 in的列的长度mysql?
char
mysql
以下查询
ALTER TABLE tablename ALTER COLUMN columnname varchar(30) not null;
不管用。
请指出我的错误。谢谢
ALTER TABLE `tablename` CHANGE `columnname` `columnname` VARCHAR( 30 ) NOT NULL
或者
ALTER TABLE `tablename` MODIFY `columnname` VARCHAR( 30 ) NOT NULL
请尝试下面给出的查询
ALTER TABLE tablename MODIFY columnname varchar(30) NOT NULL;
你可以参考这个教程