MySQL dump certain query/queries then load to remote server
Posted: Tue Oct 20, 2009 5:42 am
Hi everyone
I'm working on a project where a company wants to make a selection of its data available to website visitors.
They have their own corporate intranet MySQL DB.
Is there any way I can just export a single query or selection of queries to a dump file?
Obviously mysqldump exports the whole lot - is there anything that can take a .sql query file and dump only those records returned by the query?
I could just export it myself in PHP but didn't want to start doing that if there's a tool that alreaedy exists for this kind of thing.
My idea was to set up a cron job to dump those queries overnight every night, upload them using scp then trigger a shell script to truncate the remote tables and insert the new data.
If I moved their whole intranet DB out onto this remote MySQL server, the intranet users would see a slight slowdown when searching/updating their data because of latency. So doing dump of only selected data sounds like the best plan.
Any ideas/suggestions?
Cheers, B
I'm working on a project where a company wants to make a selection of its data available to website visitors.
They have their own corporate intranet MySQL DB.
Is there any way I can just export a single query or selection of queries to a dump file?
Obviously mysqldump exports the whole lot - is there anything that can take a .sql query file and dump only those records returned by the query?
I could just export it myself in PHP but didn't want to start doing that if there's a tool that alreaedy exists for this kind of thing.
My idea was to set up a cron job to dump those queries overnight every night, upload them using scp then trigger a shell script to truncate the remote tables and insert the new data.
If I moved their whole intranet DB out onto this remote MySQL server, the intranet users would see a slight slowdown when searching/updating their data because of latency. So doing dump of only selected data sounds like the best plan.
Any ideas/suggestions?
Cheers, B