MySQL Forums
Forum List  »  General

logging mysql errors in linux shell script
Posted by: Tommy Peterson
Date: July 13, 2016 02:50PM

I have inherited a sh linux script that executes mysql statements. Sometimes these things are failing for various reasons. But because the script was written as it was I cam not getting log entries for the failure codes/reasons. Here is an example:

mysql -e "DROP TABLE mytesttable;" >>$logfile 2>&1

I think it is the "-e" switch but am not sure. The $logfile resolves. And it exists. And if I wrote "LOG "Hello"" above or below this line then "Hello" gets written to $logfile.

While this is a shell script question it really involves how to interact with MySQL. So hopefully someone can help.

Options: ReplyQuote


Subject
Written By
Posted
logging mysql errors in linux shell script
July 13, 2016 02:50PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.