MySQL ERROR 1005 (HY000): Can’t create table ‘Table.frm’ (errno: 150)
If you’re trying to import an sql file using symfony propel-insert-sql and you get this error :
ERROR 1005 (HY000): Can't create table 'Table.frm' (errno: 150)
check this command output it’s really helpful :
mysql>SHOW ENGINE INNODB STATUS;
it will give you the detailed explanation about the most recent innoDB foreign key error.
If you are using a mysqldump file add these commands at the top and bottom of the sql file
SET FOREIGN_KEY_CHECKS = 0; -- TOP SET FOREIGN_KEY_CHECKS = 1; -- BOTTOM
that will disable constraints check



Thanks for the post! Ya saved me some time this morning :-)
Also, that’s a pretty cool plugin for displaying code (assuming its a plugin).
you’re welcome ;-)
yes, the plugin is cool you can grab it from http://wordpress.org/extend/plugins/google-syntax-highlighter
good!
when I use solidDB ,I meet this question too.
^&^
Thanks for that initial post… exactly what I needed.
i had sucessfully created table on mysql, but frm file the table i was create cann’t found.
please help me..
thanks.
Dont’ forget to have the referencing field type matching the referenced field type. Foreign key field must not be too narrow or too wide compared with referenced primary key.
Ciao!
Positioning is broken in opera 9.52
Thanks buddy for the help!!!
Hi and thank you for this post, it helped me a lot.
Best regards
This is genious, thanks! I spent like 3 hours trying to figure this out. I had a dup key name, from a previously created table! Wow.
well, hi admin adn people nice forum indeed. how’s life? hope it’s introduce branch ;)
That was really helpful…
thnx
Nice tip. Just what i was looking for. Also, im interested in integrating your code theme into my wordpress blog. Was it included in a theme or do you have a js script?
Thx,
JJ
Thanks, it really helped me a lot. I’m using propel from symfony and wanted to use a part of the generated SQL, but it didn’t work work without these two commands.
It helped me a lot. After breaking my head on debugging I got your post and it took second to fix the “ERROR 1005 (HY000): …….(errno: 150)”. Thanks a lot
great this helped me out too! thanks!
Thanks man
Helped a lot
I read that and found no answer for my case.
The key behind is more simple than we might know or think that it is.
Add a simple UNIQUE (column_name) where you know those entries are really unique.
MySQL do not know this, so you have to identify this for the logic in mysql and all goes right !
Chears n Beers
Thanks man u r geniues..That solution saved lots of my work.
Thanks, this really helped me with installing the sample data for Magento.
Thanks brainfault.
These bleeding edge error messages by MySQL are so helpful :-) in understanding what went wrong! But then beggars can’t be choosers !
Thanks, worked like a charm. I appreciate your help.
Thanks Sadri
searching for the problem on on google, I found you tip…. great!
/C.
Thanks, it really helped me a lot. I’m using propel from symfony and wanted to use a part of the generated SQL, but it didn’t work work without these two commands. when I applied these commands, voila…. worked…