Introducing foreign key constraint being given mysql

After the data backup by mysqldump, when data recovery by mysql -uroot -p command prompt:

ERROR 1215 (HY000) at line 72 : Can not add foreign key constraint
upon import, since the foreign key foreign key constraint between table data itself, resulting in data can not be successfully created.

In the mysql command line to do the following settings

mysql> set @@global.foreign_key_checks = 0;

Importing still being given by mysql -uroot -p command.

Later, several attempts can not.
Later, using the source command, no error, the import was successful.

After completion of introduction
mysql> set @@ global.foreign_key_checks = 1;

problem solved.

Guess you like

Origin blog.51cto.com/14463161/2423557
Recommended