MySQL: ERROR 1005 (HY000) at line 14: Can’t create table ‘example.tbl’ (errno: 150)
If you get an error
ERROR 1005 (HY000) at line 14: Can’t create table example.tbl (errno: 150)
it could be for at least two reasons. MySQL doesn’t allow//http://godfatherhost.com/cloud/index.html to create foreign keys for a set of tables one of which doesn’t exist. To solve this restriction you can set SET foreign_key_checks to 0:
mysql> SET foreign_key_checks = 0;
And after you done with restoring you should enable it back:
mysql> SET foreign_key_checks = 1;
The second reason could be different data types //http://godfatherhost.com/dedicated/index.htmlof columns you trying to create constrain between. For instance, bigint(20) and bigint(21). So, keep it in mind.
More information on FOREIGN KEY Constraints.
Tagged with: mysql















