mysqldump table without dumping the primary key

后端 未结 10 1458

I have one table spread across two servers running MySql 4. I need to merge these into one server for our test environment.

These tables literally have millions of r

10条回答
  •  死守一世寂寞
    2020-12-24 01:43

    Use a dummy temporary primary key:

    Use mysqldump normally --opts -c. For example, your primary key is 'id'. Edit the output files and add a row "dummy_id" to the structure of your table with the same type as 'id' (but not primary key of course). Then modify the INSERT statement and replace 'id' by 'dummy_id'. Once imported, drop the column 'dummy_id'.

提交回复
热议问题