MySQL import - How to ignore Drop table if exists line?

后端 未结 3 1882
走了就别回头了
走了就别回头了 2021-02-13 12:57

I exported 2 identical databases(identical in terms of names and structures of tables) into two .sql files using mysqldump. I want to merge them into one file. However, both the

3条回答
  •  天命终不由人
    2021-02-13 13:28

    All you need is add --skip-add-drop-table option when using mysqldump.

    $ mysqldump --databases --skip-add-drop-table -u root db1 > /tmp/qqq.2
    

    So, there would not DROP TABLE IF EXISTS in sql files.

    see docs of mysql on --skip-add-drop-table

提交回复
热议问题