Check for referential integrity

In my process, I am doing something like:

SET FOREIGN_KEY_CHECKS = 0;
LOAD DATA INFILE '/path/to/mytable.txt' INTO TABLE mytable;
SET FOREIGN_KEY_CHECKS = 1;

Now I need to check that the data after this import does not violate referential integrity. I would like to do something like

check database all foreign_keys;

Is there a similar command? If not, how to do it?

Environment: MySQL v5.1.xx with InnoDB

thank

+3
source share
2 answers

Answer

Here is the code that does what you need. There seems to be no such team.

Story

, MySQL, , . , , . "" .

, .

. 5.1

, , , , , .

+3

Source: https://habr.com/ru/post/1765126/


All Articles