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 !
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
精彩评论