首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Mysql >

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

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

使用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.

热点排行