K
K
khodos_dmitry2019-11-21 12:01:06
MariaDB
khodos_dmitry, 2019-11-21 12:01:06

Error: 150 "Foreign key constraint is incorrectly formed" when creating a new table?

The manga_tag table already existed. But it disappeared after I tried to change the foreign key. An error occurred and the table disappeared. Now, when I try to create this table again, I get this error:

#1005 - Невозможно создать таблицу `table`.`manga_tag` (ошибка: 150 "Foreign key constraint is incorrectly formed")

When requested:
SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE TABLE_SCHEMA ='table' AND CONSTRAINT_NAME <>'PRIMARY'

There are no keys associated with manga_tag

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
khodos_dmitry, 2019-11-21
@khodos_dmitry

I solved the problem by exporting and importing back the entire database.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question