How do I rename a column in table xyz
? The columns are:
Manufacurerid, name, status, AI, PK, int
I want to rename to manufacturerid
I tried using PHPMyAdmin panel, but I get this error:
MySQL said: Documentation
#1025 - Error on rename of '.\shopping\#sql-c98_26' to '.\shopping\tblmanufacturer' (errno: 150)
The standard Mysql rename statement is:
for this example:
Reference: MYSQL 5.1 ALTER TABLE Syntax
SYNTAX
alter table table_name rename column old column name to new column name;
Example:
alter table library rename column cost to price;
Lone Ranger is very close... in fact, you also need to specify the datatype of the renamed column. For example:
Remember :
EDIT
You can rename fields using:
http://dev.mysql.com/doc/refman/5.1/en/alter-table.html
With MySQL 5.x you can use:
Renaming a column in MySQL :