K
K
ksvdon2014-08-24 14:17:26
linux
ksvdon, 2014-08-24 14:17:26

How to catch a traceback?

I start MySQL with parameters and when I exit I have a traceback instead of the usual "bye". When I try to save what is displayed to me (standard output and standard error output), I do not get anything in a file ...
(it looks something like this:

cat >mysqlquit <<EOF
quit
EOF

service mysql stop
service mysql start --параметры
mysql -uroot <./mysqlquit > result.txt 2>&1
echo $? >>result.txt

) Only on the recording screen... Also, the exit code, oddly enough, is "0"... As if everything went smoothly, but the traceback... Tell me how to "register" this error. What would automatically be able to conclude whether there was an error or not. Maybe something is written to the log of mysql itself or to the system log or somewhere else. Thanks in advance for the options.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vadim Misbakh-Soloviev, 2014-08-24
@mva

use 2>&1 BEFORE the redirect in result.txt, not after it :)
Even better
mysql -uroot <./mysqlquit &>result.txt

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question