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?
Yes, it's a foreign key error. Do
show innodb statusimmediately after youralter tableattempt, 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...)