Have not touched DOS command line for many years.
I set up an intranet running XAMPP under XP recently. The hardware is pretty aged so I have to backup the database just in case. I use XP’s scheduler to run a batch file daily during lunch time. The batch file looks like this
title backup database by mysqldump
for /f "tokens=1-4 delims=/ " %%a in ('date/t') do (
@ECHO Beginning backup of database %dbname%...
%mysqldir%\bin\mysqldump --opt --user=%dbuser% --password=%dbuserpwd% %dbname% > %dumpfile%
FOR %%A IN (%dumpfile%) DO SET FileSize=%%~zA
@ECHO New File: %dumpfile% %FileSize%bytes
This is just for one database so instead of looping through databases in a single batch file I did the lazy way of using another batch file to
CALL a series of batch files with one batch file for each database.
Restoring the mysql dump file should be (in my To-Do list) straight forward. I’ll try this manually at command line.
mysql -u root -p[root_password] [database_name] < dumpfilename.sql