How to Rename a Field in a MySQL Table

How to Rename a Field in a MySQL Table

No Comments on How to Rename a Field in a MySQL Table

To change the name of a field in a MySQL database table use the CHANGE keyword with ALTER TABLE. You must also supply the field type again or you can change that too in the same line.

Example:

ALTER TABLE mytable CHANGE oldname newname VARCHAR(32);

About the author:

Bill Payne started working as a paid professional software developer at the young age of 12 years old developing simple games and other applications for pre-packaged computers. Bill has since developed software for many industries such as direct sales and the the stock market. Bill has now started sharing his many years of software development experience through a blog on the MPSHouse website and one on one lessons.

Leave a comment

Back to Top