将MySQL中sql运行结果保存到文件
2016-11-09 17:02
405 查看
方法一:在mysql>提示符中使用tee
mysql> tee output.txt
Logging to file 'output.txt'
mysql> notee
Outfile disabled.
或者
mysql> \T output.txt
Logging to file 'output.txt'
mysql> \t
Outfile disabled.
这个类似于sqlplus的spool功能,可以将命令行中的结果保存到外部文件中。如果指定已经存在的文件,则结果会附加到文件中。
方法二:使用mysql命令行工具的--tee参数
$mysql --tee=ot.txt
Logging to file 'ot.txt'
mysql>
这回将所有的输入和输出内容都记录到指定的文件中(直到exit为止)。如果指定已经存在的文件,则结果会附加到文件中。
mysql> source d:/exchange.sql;
Query OK, 2 rows affected (0.00 sec)
Records: 2 Duplicates: 0 Warnings: 0
mysql> tee output.txt
Logging to file 'output.txt'
mysql> notee
Outfile disabled.
或者
mysql> \T output.txt
Logging to file 'output.txt'
mysql> \t
Outfile disabled.
这个类似于sqlplus的spool功能,可以将命令行中的结果保存到外部文件中。如果指定已经存在的文件,则结果会附加到文件中。
方法二:使用mysql命令行工具的--tee参数
$mysql --tee=ot.txt
Logging to file 'ot.txt'
mysql>
这回将所有的输入和输出内容都记录到指定的文件中(直到exit为止)。如果指定已经存在的文件,则结果会附加到文件中。
mysql> source d:/exchange.sql;
Query OK, 2 rows affected (0.00 sec)
Records: 2 Duplicates: 0 Warnings: 0
相关文章推荐
- 将MySQL中sql运行结果保存到文件
- 将MySQL中sql运行结果保存到文件
- Mysql 将结果保存到文件 从文件里运行sql语句 记录操作过程(tee 命令的使用)
- 将MySQL中sql运行结果保存到文件
- Mysql 将结果保存到文件 从文件中执行sql语句 记录操作过程(tee 命令的使用)
- 启用sqlplus的explain功能,保存结果至文件,查看sql的执行计划
- 【MYSQL】命令行运行SQL文件
- 把mysql查询结果保存到文件的shell脚本
- mysql 运行sql脚本文件
- 把mysql查询结果保存到文件的shell脚本
- 如何使用BAT文件批量运行SQL语句,并保存执行结果
- PowerShell中使用Out-File把字符串或运行结果保存到文件的方法
- ruby连接mysql,并在中间用memcached保存sql结果
- mysql将查询结果保存到文件
- 运行cmd状态下MySQL导入导出.sql文件
- sqlplus中怎么将你所有的操作和结果记录保存到你指定的文件中
- mysql 查询结果保存到文件
- mysql 运行sql脚本文件
- MySQL 把查询结果保存到文件中的方法
- 运行cmd状态下MySQL导入导出.sql文件