The Passionate Craftsman

Ruby, PHP, MySql, Software engineering and more.

Monday 23 November 2009

ERROR 1005 (HY000) at line...: Can’t create table ... (errno: 150)

If you get an error simialr to this:

ERROR 1005 (HY000) at line 244: Can’t create table ‘./intranet2/dept.frm’ (errno: 150)

It means that you should turn off the mysql integrity check with this command:

SET FOREIGN_KEY_CHECKS = 0;

In my case was not enough, I had to remove the to foreign key of that table, load the dump and then recreate the foreign keys. The where some orphan rows, some I removed the problem and applied the foreign keys again.

Labels:

1 Comments:

At 24 July 2011 at 04:42 , Anonymous Fred said...

Thanks for helping me fixing that trouble :)

 

Post a Comment

Subscribe to Post Comments [Atom]

<< Home