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

前端 未结 5 1958
深忆病人
深忆病人 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 06:46

    This may happen if you use --compact as one of your mysqldump command. --compact includes --skip-comments so instead --compact one should use --skip-add-drop-table --skip-add-locks --skip-disable-keys --skip-set-charset

提交回复
热议问题