Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

mysql dump/export

Before each running of my job I wish to make a mysql backup to a file of the effected tables. Is this possible with one of the available components?
Labels (2)
8 Replies
Anonymous
Not applicable
Author

Hello
You can use the tMysqlRow component which is used to execute sql statement.
Best regards

shong
Anonymous
Not applicable
Author

what about using mysqldump command to dump a number of tables?
we have over 20 tables that we want to transfer between database servers using a taldend job, and going table by table is going to be crazy.
Anonymous
Not applicable
Author

Hello
What you can do is sometihing like: mysqldump -u -p mydatabase table1 > table1.sql, you can do one command for each command you want.
Anonymous
Not applicable
Author

Hello
What you can do is sometihing like: mysqldump -u -p mydatabase table1 > table1.sql, you can do one command for each command you want.

which component should i use for that? tsystem?
Anonymous
Not applicable
Author

which component should i use for that? tsystem?

Correct, or SSH
Anonymous
Not applicable
Author

I had a mysqldump statement working fine in a tSSH component and I wanted to migrate it to a tsystem as the dump need to be done on the same machine (it saved my to manage login and password for the tSSH).
So I've been cut and past the code from tSSH to tSystem using Single Command. The code is (I've all my context variable set up properly)
"mysqldump -u " context.Login " -p" context.Password " --databases " context.dbname " > /home/" context.source "/Archive/" TalendDate.getDate("YYYYMMDD_hhmmss") "_" context.source ".sql"

Then in the standard output I've the following choices:
- to console: print the command on screen but doesn't run it (useful to check that variable are properly used but doesn't do the job)
- to global variable: data is passed on to an output variable linked to the tSystem component. Not really what I want to do
- to console and to global variable: same comment as previously
- normal: data is passed on to the component that comes next, so I plug a tFileDelimited after and it wrote the mysqldump statement instead of the proper dump
So I guess I am missing something, thanks for your help.

tSystem documentation page:
https://help.talend.com/search/all?query=tSystem&content-lang=en
Anonymous
Not applicable
Author

Hi magdmartin
Export the Error output to the console, it will print the error on the console if it has error when executing this SQL. From your command, I see the only place in question is the date pattern for the method TalendDate.getDate(), it should be:
TalendDate.getDate("yyyyMMdd_hhmmss") or TalendDate.getDate("yyyyMMdd_HHmmss")
Shong
Gulshan_Kumar
Contributor
Contributor

Use the following command in tsystem by using home directory where mysql server is installed.

 

"cmd /c mysqldump -v -h localhost --user=root --password=123456 --all-databases > c:/temp/data/etldump.sql"

 

Regards

Gulshan Kumar