How do I dump MySQL file without Foreign Keys via command line?

后端 未结 3 871
予麋鹿
予麋鹿 2020-12-16 03:06

I need to export a large database without foreign keys. What is the command to do this?

This is what I tried but I know this is incorrect.

mysqldump         


        
3条回答
  •  抹茶落季
    2020-12-16 03:50

    you can use the --init-command flag on a per-session basis:

    mysql --init-command="SET SESSION FOREIGN_KEY_CHECKS=0;" ... < dump.sql
    

提交回复
热议问题