List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:September 29 2000 4:06pm
Subject:Re: Best way of copying a database every week
View as plain text  
In the last episode (Sep 29), Paul Hampton said:
> I'm wanting to run a mysqldump from one server to another every week
> automatically using cron. If I dump into the new database without
> clearing the data from the previous week, what will happen? Will it
> overwrite, skip or duplicate the entries? They have a unique key so I
> expect it will just scip them, but what if other fields are changed?
> 
> Does anyone already do this and if so could you tell me whether you
> use 1 cron job or two - one on each server.

The ideal solution is to use the new replication features of mysql;
this only works if your machines can see each other over TCP/IP,
though.

If you can't use replication, try adding "--add-drop-table" to your
mysqldump commandline.  That'll make mysql drop the previous version of
the table before loading the new data.

-- 
	Dan Nelson
	dnelson@stripped
Thread
Best way of copying a database every weekPaul Hampton29 Sep
  • RE: Best way of copying a database every weekSam Masiello29 Sep
  • Re: Best way of copying a database every weekMark Hodnett29 Sep
  • Re: Best way of copying a database every weekDan Nelson29 Sep
Re: Best way of copying a database every weekWee Chua29 Sep