echo "INSERT INTO t1 VALUES ( 1 )" | mysql -vvv foo_db
http://stackoverflow.com/questions/25397635/mysql-commandline-execution-of-query-with-its-output-having-the-rows-affected