Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

unable to dump mysql database table using tsystem in talend

Hi 

am trying to dump mysql database tables using tsystem component in talend 

 main syntax  :-

"mysqldump -u user-p dbname tablename > file.sql"  

using this am getting error like mysqldump: Couldn't find table: ">"

after modified syntax : -

 mysqldump -u user-p dbname tablename like this am getting dump completed successfully but file not found.if i given path and file it's showing error 

how to resolve this ??? please suggest

Labels (3)
1 Solution

Accepted Solutions
Jesperrekuh
Specialist

Could you instead of doing > use: --result-file

View solution in original post

7 Replies
fdenis
Master


try with escape char something like
%mysqldump -u user-p dbname tablename% > file.sql

or

call "mysqldump -u user-p dbname tablename" > file.sql
Jesperrekuh
Specialist

This is a continuation of this thread: please stick to one?!
https://community.talend.com/t5/Design-and-Development/unable-to-get-output-sql-file-from-db-source/...

However if you specify a path, in Java you need to double the slash... like C:\\folder\\out.sql
Slash , \ is a escape character.
try this and see if it works, put this into your tSystem:
"cmd /c dir *.* > C:\\data\\_out.txt"
Jesperrekuh
Specialist

In tSystem it works for me:

"cmd /c mysqldump -v -h localhost --user=bcketl --password=mypwd datastage etl_source_files >c:\\data\\etldump.sql"

 

Starting job test at 14:17 29/08/2018.

[statistics] connecting to socket on port 3816
[statistics] connected
mysqldump: [Warning] Using a password on the command line interface can be insecure. -- Connecting to localhost... -- Retrieving table structure for table etl_source_files... -- Sending SELECT query... -- Retrieving rows... -- Disconnecting from localhost...
[statistics] disconnected
Job test ended at 14:17 29/08/2018. [exit code=0]
Anonymous
Not applicable
Author

Both cases r not working showing as could n't find table ">"
Anonymous
Not applicable
Author

here am trying this command from talend after build the job am calling in ubuntu server which my sql placed in it.

again am getting the same issue
mysqldump: Couldn't find table: ">"
-- MySQL dump 10.13 Distrib 5.7.23, for Linux (x86_64)
--
-- Host: 192.168.20.21 Database: kafnu
-- ------------------------------------------------------
-- Server version 5.7.23-0ubuntu0.16.04.1

/*!40101 SET @old_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @old_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @old_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @old_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @old_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @old_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @old_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @old_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
Jesperrekuh
Specialist

Could you instead of doing > use: --result-file
Anonymous
Not applicable
Author

Hi Dijke,
Thank u so much it works fine now and dumping tables after using this --result-file