6

When using MySQL to run an UPDATE or INSERT, I get query result info:

Query OK, 0 rows affected (0.00 sec)
Rows matched: 1  Changed: 0  Warnings: 0

When using MySQL from the command line (eg: mysql -e "UPDATE ...") I get no output for successful queries.

How can I get the query result info to output when using the --execute argument?

1 Answer 1

10

Run with -vv, that will print the query being ran as well as the results you're looking for

2
  • 1
    #til there's -v -vv and -vvv (maybe more, but that's probably it), in the MySQL docs it describes it as -v -v -v Commented Jul 13, 2017 at 9:58
  • Also worth mentioning that the -vv output is useful when running sql from a file. e.g. mysql -uuzaname -p -hremote.com -vv < myfile.sql Commented Jul 13, 2017 at 9:59

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.