Copy some tables

Tintenmann posted 2 years ago in General
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

ansgar posted 2 years ago
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
Tintenmann posted 2 years ago
Thanks, it works!
Tintenmann posted 2 years ago
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 posted 2 years ago
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.