Schedule an export? Using command line?

[expired user #3273]'s profile image [expired user #3273] posted 16 years ago in Import/Export Permalink
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's profile image ansgar posted 16 years ago Permalink
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.
[expired user #3273]'s profile image [expired user #3273] posted 16 years ago Permalink
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.
[expired user #3409]'s profile image [expired user #3409] posted 16 years ago Permalink
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:
heidisql.exe -u USERNMAE -h HOSTENAME -p PASSWORD -db DBNAME

Verbinden ist kein Problem, aber wie kann ich nun eine SQL-Datei "Import.sql" ebenfalls automatisch ausf
ansgar's profile image ansgar posted 16 years ago Permalink
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.
[expired user #3409]'s profile image [expired user #3409] posted 16 years ago Permalink
Ich m
ansgar's profile image ansgar posted 16 years ago Permalink
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.
[expired user #3409]'s profile image [expired user #3409] posted 16 years ago Permalink
Schade, denn wenn ich eine TXT Datei Uploaden m
ansgar's profile image ansgar posted 16 years ago Permalink
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?
[expired user #3409]'s profile image [expired user #3409] posted 16 years ago Permalink
Wir m
ansgar's profile image ansgar posted 16 years ago Permalink
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.
[expired user #1125]'s profile image [expired user #1125] posted 16 years ago Permalink
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.