How to Rename a Field in a MySQL Table

27 July , 2011 Bill MySQL Database

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.


ALTER TABLE mytable CHANGE oldname newname VARCHAR(32);

how to, linux, mysql, osx, server,

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Powered by WordPress. Designed by elogi.