tags:

views:

22

answers:

1

I want to rename a field of a table in MySQL ver 5.2.25, from "alter table", but I got this error:

SQL Error 1025: Error on rename of '.\Packers\#sql-804_3' to '.\Packers\pattern' (errno: 150)

but on other table I had not this problem, I don't know why, is it caused by foreign key?

A: 

Yes, it's a foreign key error. Do show innodb status immediately after your alter table attempt, and part of the output will be the last foreign key error details.

Generally it's caused by a data type mismatch on the foreign key fields (it's 'int' in one table but 'bigint' in your alter table, or one's unsigned and the other's not, etc...)

Marc B
Hi, Error is not caused by data type, this is the result of "show innodb status":=====================================101030 13:50:43 INNODB MONITOR OUTPUT=====================================Per second averages calculated from the last 45 seconds----------SEMAPHORES----------OS WAIT ARRAY INFO: reservation count 4, signal coun...
rain
The status output is way too big to paste into a comment. edit your question and paste it there.
Marc B