MySQL 不显示输出结果

有的时候,想看看语句执行时间有多长,但是有不想看的刷屏的输出,各个数据库可以用下面的方法:
 (1)Oracle: set autotrace trace,恢复的话,用set autottrace off
 (2)postgresql: EXPLAIN ANALYZE
 (3)MySQL: pager cat > /dev/null,恢复的话,直接打pager

MySQL的举例说明一下:

mysql> pager
Default pager wasn't set, using stdout.
mysql>
mysql> select count(*) from orasup1;
+----------+
| count(*) |
+----------+
| 960896 |
+----------+
1 row in set (0.60 sec)

mysql> pager cat > /dev/null
PAGER set to 'cat > /dev/null'
mysql>
mysql> select count(*) from orasup1;
1 row in set (0.65 sec)

mysql> pager
Default pager wasn't set, using stdout.
mysql>
mysql> select count(*) from orasup1;
+----------+
| count(*) |
+----------+
| 960896 |
+----------+
1 row in set (0.63 sec)

mysql>

参考: Fun with the MySQL pager command