mysqldump table without dumping the primary key

后端 未结 10 1459

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:50

    I like the temporary table route.

    create temporary table my_table_copy
    select * from my_table;
    
    alter table my_table_copy drop id;
    
    // Use your favorite dumping method for the temporary table
    

    Like the others, this isn't a one-size-fits-all solution (especially given OP's millions of rows) but even at 10^6 rows it takes several seconds to run but works.

提交回复
热议问题