4

Let's say I run a query in MySQL

mysql> delete from subscriber where mobile in (9899347241); Query OK, 2 rows affected, 18 warnings (32.91 sec)

So now I have a abc.sql which contains no. of such delete, update sql's and I run it using

mysql -h host -u user -p < abc.sql > output.txt

I have tried different options like --verbose, --tee. None seems to log the info text Query OK, 2 rows affected, 18 warnings (32.91 sec)

How can i log this. Basically when I have run the batch file, I want to be able to see if each query ran ok. One way for me to do this is to include a select query before and after the delete/update but there must be a better way to see if queries ran successfully.

1
  • Could be writing those messages to STDERR instead of STDOUT. Try adding 2>&1 to redirect stderr so it can be captured. Commented Mar 1, 2012 at 17:45

2 Answers 2

7

-vvv is the solution to what we are looking for.

Sign up to request clarification or add additional context in comments.

Comments

-1

2>&1 is what you are looking for

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.