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?


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

  • 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 – chim Jul 13 '17 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 – chim Jul 13 '17 at 9:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.