mysql dump - exclude some table data

后端 未结 8 1482
独厮守ぢ
独厮守ぢ 2021-01-30 10:40

Is it possible, using mysql dump to export the entire database structure, but exclude certain tables data from export.

Say the database has 200 tables, I wish to export

8条回答
  •  臣服心动
    2021-01-30 10:49

    In my opinion the best answer is from Steak, the only answer really working on any case.

    All the answers suggesting two dumps are wrong, or at least they can work just under certain premises.

    As many have pointed above you can have problems with sequences.

    But I find more critical that the database can have triggers that validate or process information (suppose a trigger that insert records on table B when inserting on table A) - in this case, the sequence of creating the full schema (including triggers) and then inserting the data will create a different set of results.

提交回复
热议问题