How do I drop 'NOT NULL' from a column in MySQL?

Posted by Will on Stack Overflow See other posts from Stack Overflow or by Will
Published on 2010-06-08T20:10:55Z Indexed on 2010/06/08 21:22 UTC
Read the original article Hit count: 150

Filed under:
|

A show create table command shows the following:

'columnA' varchar(6) NOT NULL DEFAULT '';

How do I modify that column so that the not null is removed? I need it to be:

'columnA' varchar(6) DEFAULT NULL;

I thought the following would work, but it has no effect:

ALTER TABLE tbl_name MODIFY columnA varchar(6) DEFAULT NULL;

© Stack Overflow or respective owner

Related posts about mysql

Related posts about alter-table