When deleting a table in mysql, an error is reported: 1217 – cannot delete or update a parent row: a foreign key constant failure. How can I find this table being referenced by the foreign keys of which tables?
1. When deleting the table in MySQL, an error is reported: 1217 – Cannot delete or update a parent row: a foreign key constraaint fail. as shown in Figure 1
2. Reference:You can get information about foreign keys from information_schema.key_column_usagetable. The query example for that table is shown here . as shown in Figure 2
3. The query results contain all foreign key information of the current connection. Find the corresponding database, table and fields. as shown in Figure 3
4. First delete the table corresponding to the column table_name in the query result, and then delete the table. Delete was successful.


