views:

27

answers:

2

How to rename the table field

in table xyz, Fields are

manufacurerid,name,status AI,PK,int

Want to rename to manufacturerid ,

I tried using phpmyadmin panel , its not working, show error,

MySQL said: Documentation
#1025 - Error on rename of '.\shopping\#sql-c98_26' to '.\shopping\tblmanufacturer' (errno: 150)
A: 

You can rename fields using:

ALTER TABLE xyz CHANGE manufacurerid manufacturerid

http://dev.mysql.com/doc/refman/5.1/en/alter-table.html

Lone Ranger
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Bharanikumar
+2  A: 

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 definition is)

Matt