开发者

How to check in batch script if "mysqldump" and "mysql" commands succeeded or not?

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜