distal-attribute
distal-attribute
distal-attribute
distal-attribute

Schedule an export? Using command line?

User, date Message
Written by bbb1981
7 years ago
Category: Import/Export
2 posts since Tue, 11 Dec 07
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.
Written by ansgar
7 years ago
4973 posts since Fri, 07 Apr 06
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.
Written by bbb1981
7 years ago
2 posts since Tue, 11 Dec 07
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.
Written by Tibi
6 years ago
5 posts since Tue, 18 Mar 08
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
Written by ansgar
6 years ago
4973 posts since Fri, 07 Apr 06
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.
Written by Tibi
6 years ago
5 posts since Tue, 18 Mar 08
Ich m
Written by ansgar
6 years ago
4973 posts since Fri, 07 Apr 06
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.
Written by Tibi
6 years ago
5 posts since Tue, 18 Mar 08
Schade, denn wenn ich eine TXT Datei Uploaden m
Written by ansgar
6 years ago
4973 posts since Fri, 07 Apr 06
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?
Written by Tibi
6 years ago
5 posts since Tue, 18 Mar 08
Wir m
Written by ansgar
6 years ago
4973 posts since Fri, 07 Apr 06
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.
Written by rosenfield
6 years ago
127 posts since Wed, 24 Jan 07
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.