Alter MySQL table to add comments on columns

Jhonny D. Cano -Leftware- picture Jhonny D. Cano -Leftware- · Jan 29, 2010 · Viewed 143k times · Source

I have been checking the MySQL Documentation for ALTER TABLE and it does not seem to include a way to add or modify a comment to a column. How can I do this?

-- for table
ALTER TABLE myTable COMMENT 'Hello World'

-- for columns
-- ???

Answer

Rufinus picture Rufinus · Jan 29, 2010

try:

 ALTER TABLE `user` CHANGE `id` `id` INT( 11 ) COMMENT 'id of user'