tags:

views:

161

answers:

2
ERROR 1025 (HY000): Error on rename of '.\forumf\#sql-1718_20' to '.\forumf\posts' (errno: 150)
  1. Is the error number 1025 or 150?
  2. I was deleting a primary key (which I had set by mistake) which was also a foreign key at the time.
  3. What is HY000?

I got this quite cryptic error message while editing keys on a MySQL table. Can someone explain the error, it's cause and it's fix?

A: 

Here is a link from a simple googling.

http://www.simplicidade.org/notes/archives/2008/03/mysql_errno_150.html

Daniel A. White
+2  A: 

Yeah, you hit a foreign key constraint.

A show innodb status; will show the cause of the problem.

A quick fix is to drop the constraint, do what you're doing, and then recreate the constraint.

tpdi