/etc/my.cnf 配置檔案
在伺服器上的/etc/my.cnf中的[client]加入 tee =/tmp/mysql_history.log即可.
查看log設置
show VARIABLES like '%log%';
命令行
mysql -uroot --tee=/tmp/mysql_history.log
mysql> tee mysql_history.log Logging to file 'mysql_history.log ' 或者 mysql> \T mysql_history.log Logging to file 'mysql_history.log '
mysql> notee Outfile disabled. 或者 mysql> \t Outfile disabled.