Changing the maximum length of a varchar column?

后端 未结 9 1738
[愿得一人]
[愿得一人] 2021-01-30 12:02

I\'m trying to update the length of a varchar column from 255 characters to 500 without losing the contents. I\'ve dropped and re-created tables before but I\'ve never been expo

9条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-30 12:54

    For MariaDB, use modify column:

    ALTER TABLE table_name MODIFY COLUMN column_name VARCHAR (500);
    

    It will work.

提交回复
热议问题