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
————————————————
本文介绍如何在MySQL中开启命令行日志记录功能,包括使用tee命令将SQL操作记录到指定文件的方法,并通过示例演示了从源SQL文件加载数据的过程。

5120

被折叠的 条评论
为什么被折叠?



