Browse - Computer Tips - How do I rename a column in MySQL?

Date: 2009feb11
Keywords: sql

Q.  How do I rename a column in MySQL?

A.  As far as I know you have to specify the new type
when renameing a column.  So its like this:

ALTER TABLE <table> CHANGE <old-col> <new-col> <new-type>;
eg:
ALTER TABLE mytable CHANGE oldcol newcol VARCHAR(255);