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

后端 未结 3 1801
走了就别回头了
走了就别回头了 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:13

    If you do not want to make dump once again and you are using Linux you can go with:

    awk '!/^DROP TABLE IF EXISTS/{print}'  | mysql 
    

    If you want to dump data once again you should pass --skip-add-drop-table to mysqldump utility.

提交回复
热议问题