读书人

应用tee记录mysql client 所有的操作

发布时间: 2012-09-06 10:37:01 作者: rapoo

使用tee记录mysql client 所有的操作
方法一、配置文件
在服务器上的/etc/my.cnf中的[client]加入
tee =/tmp/client_mysql.log即可.


方法二、命令行
1.mysql -uroot --tee=/tmp/client_mysql.log

2.这个类似于sqlplus的spool功能,可以将命令行中的结果保存到外部文件中。如果指定已经存在的文件,则结果会附加到文件中。
mysql> tee client_mysql.log
Logging to file 'client_mysql.log '
或者
mysql> \T client_mysql.log
Logging to file 'client_mysql.log '

mysql> notee
Outfile disabled.
或者
mysql> \t
Outfile disabled.

读书人网 >Mysql

热点推荐