mysql source输出记录日志

时间:2021-04-19 15:24:58   收藏:0   阅读:0

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
————————————————
版权声明:本文为CSDN博主「细雨9523」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_29914581/article/details/113596271

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!