You can use the mysql
command from the shell with the -v
option, it will display the query followed by the results:
$ mysql -v -e 'select * from barmar_test';
--------------
select * from barmar_test
--------------
+-----------+-----------+---------+------+------+---------------------+------+
| username | timestamp | partner | e | en | t | ttx |
+-----------+-----------+---------+------+------+---------------------+------+
| foo | NULL | abc | N1 | NULL | 2013-07-03 23:27:47 | NULL |
| foo | NULL | abc | 1 | NULL | 2013-07-03 23:25:12 | NULL |
| NULL | NULL | abc | 12 | NULL | 2013-07-03 23:25:12 | NULL |
| foo | NULL | abc | NULL | NULL | 2013-08-30 15:01:39 | NULL |
| foobarbaz | NULL | abc | NULL | NULL | 2013-09-02 13:04:00 | NULL |
+-----------+-----------+---------+------+------+---------------------+------+