如何快速完成MaxCompute 导入数据?
> 云栖号快速入门:[【点击查看更多云产品快速入门】](https://yqh.aliyun.com/?cate=%E5%BF%AB%E9%80%9F%E5%85%A5%E9%97%A8) > 不知道怎么入门?这里分分钟解决新手入门等基础问题,可快速完成产品配置操作! 本文为您介绍如何使用Tunnel命令导入数据到MaxCompute。 MaxCompute提供[多种数据导入导出方式](https://help.aliyun.com/document_detail/51656.html?spm=a2c4g.11186623.2.10.78301d26IYvXZn#concept-am2-p3f-vdb),本文主要介绍在客户端上使用[Tunnel命令操作](https://help.aliyun.com/document_detail/27833.html?spm=a2c4g.11186623.2.11.78301d26MUPVPP)进行数据导入。 **Tunnel命令导入数据** 1.准备数据 。 将测试数据下载至本地备用,假设存放路径为D:\。本文中使用的测试数据为**banking.txt**,主要用于记录各人员的年龄、工作、房贷等信息,选取其中前三条数据展示如下。 ``` 44,blue-collar,married,basic.4y,unknown,yes,no,cellular,aug,thu,210,1,999,0,nonexistent,1.4,93.444,-36.1,4.963,5228.1,0 53,technician,married,unknown,no,no,no,cellular,nov,fri,138,1,999,0,nonexistent,-0.1,93.2,-42,4.021,5195.8,0 28,management,single,university.degree,no,yes,no,cellular,jun,thu,339,3,6,2,success,-1.7,94.055,-39.8,0.729,4991.6,1 ``` 2.(可选)创建MaxCompute表。 如果您已完成[创建和查看](https://help.aliyun.com/document_detail/27808.html?spm=a2c4g.11186623.2.13.78301d26QmFAQC#concept-rkk-kcy-5db)表示例中bank_data表的创建,请跳过本步骤,否则请参照示例创建表bank_data。 3.执行Tunnel命令。 登录MaxCompute客户端执行如下命令进行数据导入。 ``` tunnel upload D:\banking.txt bank_data; ``` 其中,是需要上传文件的本地路径。为将要导入的表名称。 当出现下图中OK字样,说明上传成功。  4.结果验证。 执行成功后,您可以使用如下语句查看表bank_data的数据条数,验证是否完成所有数据上传,示例数据中共有41188条数据。 ``` SELECT COUNT(*) FROM bank_data; ```   **其他导入方式** 除了通过客户端导入数据,您也可以使用[MaxCompute Studio](https://help.aliyun.com/document_detail/50896.html?spm=a2c4g.11186623.2.18.78301d26sR9iHQ#concept-zrp-lyx-5db)、[Tunnel SDK](https://help.aliyun.com/document_detail/34614.html?spm=a2c4g.11186623.2.19.78301d265jq2Xz#concept-utw-vvc-5db)、[数据集成](https://help.aliyun.com/document_detail/72961.html?spm=a2c4g.11186623.2.20.78301d26ItV1Zo#concept-dr3-k2v-42b)、开源的Sqoop、Fluentd、Flume、LogStash 等工具将数据导入到MaxCompute,详情请参见[数据上传下载-工具介绍](https://help.aliyun.com/document_detail/51654.html?spm=a2c4g.11186623.2.21.78301d26neMvBK)。 **后续步骤** 当数据导入到MaxCompute后,可以在MaxCompute上[运行SQL](https://help.aliyun.com/document_detail/27810.html?spm=a2c4g.11186623.2.22.78301d26QBODqz#concept-tgf-v5y-5db)来处理数据。 本文来自 阿里云文档中心 [MaxCompute 导入数据](https://help.aliyun.com/document_detail/27809.html) > 【云栖号在线课堂】每天都有产品技术专家分享! > 课程地址:https://yqh.aliyun.com/zhibo > 立即加入社群,与专家面对面,及时了解课程最新动态! > 【云栖号在线课堂 社群】https://c.tb.cn/F3.Z8gvnK