Q:

How do I identify all foreign key references to a primary key throughout an entire database?

My question is about foreign keys. For example, we have table X with X_PK and tables A, B, C with null A_FK_X and null B_FK_X. Table C doesn't contain an FK to table X. Table A already had records with A_FK_X initialised, but table B doesn't. 
Is it possible to find all usages of specified X_PK in all tables?

A:

You want to use the information_schema database. Try this code (albeit with oversimplified CREATE TABLE statements):
CREATE TABLE `X` (
    `X_id` INT NOT NULL AUTO_INCREMENT,
    PRIMARY KEY  (`X_id`)
  );

  CREATE TABLE `A` (
    `A_id` INT NOT NULL AUTO_INCREMENT,
    `X_id` INT NULL,
    PRIMARY KEY  (`A_id`),
    CONSTRAINT `A_FK_X` FOREIGN KEY (`X_id`) REFERENCES `X` (`X_id`)
  );

CREATE TABLE `B` (
    `B_id` INT NOT NULL AUTO_INCREMENT,
    `X_id` INT NULL,
    PRIMARY KEY  (`B_id`),
    CONSTRAINT `B_FK_X` FOREIGN KEY (`X_id`) REFERENCES `X` (`X_id`)
  );

CREATE TABLE `C` (
  `C_id` INT NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`C_id`)
);

USE information_schema;
SELECT * FROM KEY_COLUMN_USAGE WHERE REFERENCED_TABLE_NAME = 'X' AND REFERENCED_COLUMN_NAME = 'X_id';

This will return all references to X_id in every database, so you could narrow your search by including a TABLE_SCHEMA:
SELECT * FROM KEY_COLUMN_USAGE WHERE REFERENCED_TABLE_NAME = 'X' AND REFERENCED_COLUMN_NAME = 'X_id' AND TABLE_SCHEMA='testdbname';

On my system, these return the same output, since I only have one database that includes references to X_id, but the output will vary depending on your database/table structure. 

