Page 1 of 1

Backing up MySQL Questions

Posted: Thu Mar 11, 2004 10:22 am
by Pyrite
I am making like a little Windows batch file to back up my files and my MySQL databases using mysqldump and then the Windows CLi CD Writting Utilities to backup to a CDRW every night. The dump command I have is:

c:\mysql\bin\mysqldump -uroot -pmypassword --all-databases > d:\Localhost-MySQL-Backup.sql

The first time that runs, it does it right. But the next time it runs, instead of over writting the file, it just clears the contents of it. So is there a way I can make mysqldump create a backup .sql file with a date/time stamp in the file name so that it doesn't get overwritten or deleted. Like make it generate Localhost-MySQL-Backup-03-11-04.sql ?

Or is there a better way to backup MySQL stuff?

Posted: Thu Mar 11, 2004 11:23 am
by Pyrite
Crap I spoke to soon... figured it out, will post code in a few minutes.

Posted: Thu Mar 11, 2004 11:50 am
by Pyrite