Dave's Brain

Browse - computer tips - mysql rename column

Date: 2009feb11

Q.  How do I rename a column in MySQL?

Q.  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);
What this info useful to you? You can donate to say thanks

Add a comment

Sign in to add a comment
Copyright © 2008-2012, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.
Advertisements: