I have started working in a project which has a big database, around 300GB. For security reasons I can not access database from my local web app. So I need to copy last 100,000 from each table.
To copy from a table to another, I know I can do:
INSERT INTO table2 SELECT * FROM table1 WHERE condition;
But how I can handle connecting to the other database?
One idea I have, it is to create a table, same structure, and use query above to move records and then dump those tables.
Is there a better way?