mysql source输出记录日志

mysql开启命令行日志(可以记录source等的日志)

mysql> tee hello.log

mysql>select now() ;

mysql>exit;  //退出mysql 客户端

查看 hello.log 文件内容如下:

mysql> select now();

用法如下:

Step 1: Login to MySQL

Step 2: In the MySQL command prompt, type the below command.

mysql> tee log.out

Logging to file 'log.out'

mysql>

You should see a message “Logging to file” displayed on the screen.

Step 3: Now, source the SQL file

mysql> source sample.sql

Step 4: The output of source command would have been logged into a file log.out.

Step 5: View the log.out

$ more log.out
————————————————

posted @ 2021-04-17 00:00  beawh  阅读(1980)  评论(0编辑  收藏  举报