Schedule an export? Using command line?

bbb1981 posted 10 years ago in Import/Export
Would it be possible to use HeidiSQL to run exports/transfers automatically? This is my situation: I have a MySQL server on my network, and a remote MySQL server that I need to transfer data from. I need to be on a VPN connection to access the remote server. If I set up a dedicated machine that is always connected to the VPN, and have two instances of HeidiSQL open, is there any way I can schedule it to automatically export from the remote to the local server? Using command line?

Thanks for any suggestions.
ansgar posted 10 years ago
The commandline doesn't allow to trigger the export options yet, only connecting to a host is implemented, just like you can see in this revision and this posting.
bbb1981 posted 10 years ago
Yea actually those posts are what inspired me to ask this question!smile

Oh well, maybe in the future there will be a "scheduler" function inside the program itself.
Tibi posted 9 years ago
Wenn ich richtig verstanden habe, kann ich also mit HeidiSQL automatisch per cmd / command Befehl mich mit einem Server verbinden.

Mein Befehl in der Batch-Datei lautet:

Verbinden ist kein Problem, aber wie kann ich nun eine SQL-Datei "Import.sql" ebenfalls automatisch ausf
ansgar posted 9 years ago
The export options cannot be invoked by command line. As HeidiSQL is a GUI application, it won't ever support too much command line handling.

I recommend using mysqldump for automated dumps.
Tibi posted 9 years ago
Ich m
ansgar posted 9 years ago
Ah sorry, so import is meant, not export. But it's the same thing: not implemented for the commandline options.

mysql(.exe) is capable of doing this on the commandline.
Tibi posted 9 years ago
Schade, denn wenn ich eine TXT Datei Uploaden m
ansgar posted 9 years ago
As you initially wrote there is an "Import.sql" which you want to execute against your database from the commandline. This is exactly what mysql.exe is for. If you get an "Access denied" there you have some problem with the credentials, either a typo or empty password or so. Should be solvable easily.

However, in your last posting you're talking about a TXT file, which might also be a SQL dump, but probably might also be CSV file with delimited data in it. There is surely a difference beween the import processes of these two file types - SQL dumps can be imported via mysql.exe, CSV files also but with a different logic, using the LOAD DATA command. So, are we talking about a SQL file or delimited data?
Tibi posted 9 years ago
Wir m
ansgar posted 9 years ago
Please stick to english, so everyone can read your postings.

HeidiSQL's commandline interface does not support executing SQL scripts, only establishing a connection, as posted above. The only solution to a scheduled import is mysql.exe . If you get an error please post that message you got. If it's still the same you wrote above "Access denied..." you definitely have an issue in your password or username. I'm very sure you'll fix that problem with one of the various postings here.
rosenfield posted 9 years ago
Meh, I for one would love to see command line options to invoke the export dialog, poke a few options in, and start the export :-P.

There's currently an option to log everything from the SQL / log window to a file, so error tracing is even covered, already.

(Error *handling* is not, but then it rarely is when it comes to scripting.)

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