mysql find db contarint
snippet in sql

mysql show check constraints

user4301

select COLUMN_NAME, CONSTRAINT_NAME, REFERENCED_COLUMN_NAME, REFERENCED_TABLE_NAME
from information_schema.KEY_COLUMN_USAGE
where TABLE_NAME = 'users';

mysql find db contarint

user7799

select *
from information_schema.key_column_usage
where constraint_name='[CONSTRAINT_NAME]'