SHARE
TWEET

Untitled

a guest Jul 18th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. INSERT INTO table_a SELECT * FROM table_b;
  2.      
  3. CREATE TABLE table_new LIKE table_a;
  4. INSERT INTO table_new SELECT * FROM table_b;
  5. ALTER TABLE table_a RENAME table_old;
  6. ALTER TABLE table_new RENAME table_a;
  7. DROP TABLE table_old;
  8.      
  9. CREATE TABLE table_new LIKE table_a;
  10. INSERT INTO table_new SELECT B.* FROM table_b B
  11. LEFT JOIN table_a A USING (id) WHERE A.id IS NULL;
  12. INSERT INTO table_a SELECT * FROM table_new;
  13. DROP TABLE table_new;
  14.      
  15. mysqldum --tab=/path/to/serverlocaldir --single-transaction <database> table_a
  16.      
  17. create table table_b like table_a;
  18.      
  19. LOAD DATA INFILE '/path/to/serverlocaldir/table_a.txt'
  20.   INTO TABLE table_b FIELDS TERMINATED BY 't' ...
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top