This is a quick batch file that will create a date based backup. The file created will be backup_dbname_year_month_day.sql This is to backup one database. You cold change one line to backup all databases if you choose.
Here it is. As with the other file it is attached to this post.
for /f “tokens=1-4 delims=/ ” %%a in (‘date/t’) do (
@ECHO Beginning backup of %dbname%…
%mysqldir%\mysqldump -B %dbname% -u %dbuser% > %bkupdir%\BackUp_%dbname%_%yy%%mm%%dd%.sql
@ECHO Done. New File: dbBkup_%dbname%_%yy%%mm%%dd%.sql
That’s it. Just change the path variables and run the batch file from the command line. You can place it anywhere you like. I place it in the backup dir and run it from there.
If you have any questions you can post a comment to this article. If you want one o one help start a thread on the forum.