[vox-tech] Altering Columns in MySQL on RedHat

David Hummel vox-tech@lists.lugod.org
Mon, 1 Dec 2003 22:38:13 -0800


On Mon, Dec 01, 2003 at 08:31:25PM -0800, Marc Elliot Hall wrote:
> My question is this: how do I change the data type of a column that's
> part of the key? Google and http://www.mysql.com/doc/ have been (so
> far) not very helpful. Any advice is appreciated!

drop the key, modify the column, recreate the key:

mysql> drop index bar_index on foo;
mysql> alter table foo modify bar text not null;
mysql> create index bar_index on foo;

-david