Can you automatically create a mysqldump file that doesn't enforce foreign key constraints?

前端 未结 5 1956
深忆病人
深忆病人 2020-12-05 06:23

When I run a mysqldump command on my database and then try to import it, it fails as it attempts to create the tables alphabetically, even though they may have a foreign key

5条回答
  •  春和景丽
    2020-12-05 07:08

    Beware. For some reason mysqldump doesn't write the FOREIGN_KEY_CHECKS=0 if the --compact option is used.

    Ciao.

提交回复
热议问题