Backing up MySQL Questions

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Backing up MySQL Questions

Post 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?
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Post by Pyrite »

Crap I spoke to soon... figured it out, will post code in a few minutes.
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Post by Pyrite »

Post Reply