Bharanikumar Bharanikumar - 1 year ago 69
MySQL Question

Error renaming a column in MySQL

How do I rename a column in table

? The columns are:

Manufacurerid, name, status, AI, PK, int

I want to rename to

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)

Answer Source

Lone Ranger is very close... in fact, you also need to specify the datatype of the renamed column. For example:

ALTER TABLE xyz CHANGE manufacurerid manufacturerid INT;

(replacing INT with whatever your column data type is--required)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download