Copy selected records from one MySQL host/server to another.
Posted on 2011-10-16
We are using MySQL 5.1.39.
We need to synchronize some project data from one database to the other.
The databases reside on different servers.
We need to copy the records for exactly one selected 'project' from ALL the tables in one database to another. For example, we need the following for all tables in a database:
SELECT * FROM table WHERE projectid=123;
There are so many tables, so we'd hate to do this one by one.
mysqldump doesn't seem to have a "SELECT" option where you can select records from each table.
What's the easiest way to do this?