homework-jianmu/docs-cn/13-operation/08-export.md

21 lines
717 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: 数据导出
---
为方便数据导出TDengine 提供了两种导出方式,分别是按表导出和用 taosdump 导出。
## 按表导出 CSV 文件
如果用户需要导出一个表或一个 STable 中的数据,可在 taos shell 中运行:
```sql
select * from <tb_name> >> data.csv;
```
这样,表 tb_name 中的数据就会按照 CSV 格式导出到文件 data.csv 中。
## 用 taosdump 导出数据
利用 taosdump用户可以根据需要选择导出所有数据库、一个数据库或者数据库中的一张表所有数据或一时间段的数据甚至仅仅表的定义。具体使用方法请参见
[TDengine 数据备份工具: taosdump](/reference/taosdump)。