我想使用talend ETL工具将.sql文件导入mysql数据库,我的机器是windows。
我尝试的是使用tSystem并编写命令是
"cmd C:/xampp/mysql/bin>mysql -u root demo <C:/xampp/mysql/bin/localhost.sql"
当我运行这个时,我得到了这个:
Starting job sqlfile at 10:51 04/09/2013.
[statistics] connecting to socket on port 3440
[statistics] connected
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\talend\TOS_DI-Win32-r104014-V5.3.1>
[statistics] disconnected
Job sqlfile ended at 10:51 04/09/2013. [exit code=0]
在控制台上,我没有收到任何错误。但是当我打开演示数据库时,它不包含任何内容。
请谁能告诉我哪里错了。
最佳答案
如果“.sql”文件中的 SQL 命令没有更改,并且您想要“一次性”交互式执行,则可以使用“tMysqlRow”并定义:
- 数据库的“连接参数”,
- “查询”(使用 SQL Builder 上传“.sql”文件的内容)
- 忽略“架构”定义,因为 SQL 命令本身是一致的
tMysqlRow的配置解释如下: https://help.talend.com/display/TalendOpenStudioComponentsReferenceGuide53EN/tMysqlRow
您可以在此处阅读使用场景(该组件是“tDBSQLRow”,但它也适用于“tMysqlRow”): https://help.talend.com/display/TalendOpenStudioComponentsReferenceGuide53EN/tDBSQLRow
关于mysql - 如何使用talend ETL工具在mysql数据库中导入.sql文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18613724/