MySQL: Can't create table (errno: 150)

后端 未结 30 3029
误落风尘
误落风尘 2020-11-22 06:48

I am trying to import a .sql file and its failing on creating tables.

Here\'s the query that fails:

CREATE TABLE `data` (
`id` int(10) unsigned NOT NUL         


        
30条回答
  •  野性不改
    2020-11-22 07:32

    I got the same problem when executing a series of MySQL commands. Mine occurs during creating a table when referencing a foreign key to other table which was not created yet. It's the sequence of table existence before referencing.

    The solution: Create the parent tables first before creating a child table which has a foreign key.

提交回复
热议问题