List:General Discussion« Previous MessageNext Message »
From:Johan De Meersman Date:January 24 2012 10:13am
Subject:Re: Copying data from one to another MySQL sesrver
View as plain text  
----- Original Message -----
> From: "bars0.bars0.bars0" <bars0.bars0.bars0@stripped>
> 
> Hi all!
> 
> I need to copy data (result set from query) from one server to
> another.
> This will be done once a month (so cron will be involved:), for data
> from previous month.
> Any ideas how can I achieve this?
> 
> Should I export query as INSERT SQL statement first and next read
> that exported file, or there is some other solutions?

That's generally the most convenient way, but you need to be able to transform the query
output to SQL statements reliably :-)

If you're only selecting from a single table, mysqldump has the option to take a where
statement. If you need to select from multiple tables I suspect you'll either have to go
through "select into outfile" and "load data infile" or write a custom script to achieve
similar functionality.


-- 
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel
Thread
Copying data from one to another MySQL sesrverbars0.bars0.bars024 Jan
  • Re: Copying data from one to another MySQL sesrverJohan De Meersman24 Jan