views:

21

answers:

1

I'm running mysqldump and mysql commands from a batch script on Windows to make a backup of a database and restore it.

How could I check in the batch script whether these commands executed correctly or end up with error ? In case of error, I would like to know what the error is.

Thanks !

+1  A: 

One possibility is, you could redirect the error to a file

mysqldump [options] > dumpfile 2> error.log

You can look for various error possibilities in the log file and take appropriate actions

Raghuram