How to query the foreign keys of which tables are the primary keys of a table in mysql

there is a DC_CommodityItem table, and the primary key is CommodityItemID
. I want to delete one of the data. If there are other tables that use CommodityItemID as a foreign key, I may report an error
how to find a table that uses CommodityItemID as a foreign key?

tried the method found by Baidu and suggested that the table does not exist:

clipboard.png

May.06,2021

Table KEY_COLUMN_USAGE is in the information_schema library, which can only be obtained by specifying the library name.

SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE REFERENCED_TABLE_SCHEMA='' AND REFERENCED_TABLE_NAME='DC_CommodityItem' AND REFERENCED_COLUMN_NAME='CommodityItemID';

the data obtained is including foreign keys

Menu