Copy some tables

[expired user #7325]'s profile image [expired user #7325] posted 10 years ago in General Permalink
Hello together,

is it possible to copy some tables of a local db with heidisql via a ssh tunnel to a db at my provider. The connections will work, but i find no easy way to copy the tables. I hope there is a way to have something like a batch workaround for a one-click-copy, because i have to do it perioticly in the same way.

Thank for help.

Kind regards

Tintenmann
ansgar's profile image ansgar posted 10 years ago Permalink
Yes, the SQL export is made for such tasks.

Ensure you have set up sessions for both the target and source servers, then:

* Connect to the source server
* Click Tools > Export database as SQL
* Check the relevant tables in the tree
* Select the target server in the "Output" pulldown menu
* Select target database in "Database" pulldown menu
* Uncheck create/drop database
* Check create tables
* click export
[expired user #7325]'s profile image [expired user #7325] posted 10 years ago Permalink
Thanks, it works!
[expired user #7325]'s profile image [expired user #7325] posted 10 years ago Permalink
OK, another question.
Because i have every day to do the same thing, the source, the target and the tableselecion is the same, i ask if there is a way to put all the explained thinks in a 'one-click-action' or is it necessary to make the steps everytime from the beginning?
ansgar's profile image ansgar posted 10 years ago Permalink
No, except for some basic settings which HeidiSQL restores the next time you call that dialog, there is no one-click solution here. But you can create such automated tasks with a shell script: Use mysqldump(.exe) to export data into a .sql file, and afterwards import that file using mysql(.exe).

Please login to leave a reply, or register at first.