Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Datenbanken (https://www.delphipraxis.net/15-datenbanken/)
-   -   Delphi You have an error in your SQL syntax; 'shell> mysqldump --op (https://www.delphipraxis.net/113216-you-have-error-your-sql-syntax%3B-shell-mysqldump-op.html)

Deltachaos 4. Mai 2008 19:15

Datenbank: MySQL • Version: k.p. • Zugriff über: MySQL direct

You have an error in your SQL syntax; 'shell> mysqldump -
 
Ich wollte per Delphi ein Backup machen aber es erscheint die Meldung (ich benutze MySQL direct):

Code:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'shell> mysqldump --opt db67713x724842 > bak.sql' at line 1
Code:
Delphi-Quellcode:
begin
  form1.FMysql.query('shell> mysqldump --opt db67713x724842 > bak.sql', true, ex);
    if ex then
    begin
      log.WriteString(inttostr(day)+'.'+inttostr(month)+'.'+inttostr(Year), inttostr(hour) +':'+ inttostr(min) +':'+ inttostr(sec), 'OK!');
      dos('['+ inttostr(hour) +':'+ inttostr(min) +':'+ inttostr(sec) +'] OK!', 60);
    end
    else
    begin
      log.WriteString(inttostr(day)+'.'+inttostr(month)+'.'+inttostr(Year), inttostr(hour) +':'+ inttostr(min) +':'+ inttostr(sec), FMysql.LastError);
      dos('['+ inttostr(hour) +':'+ inttostr(min) +':'+ inttostr(sec) +'] '+FMysql.LastError, 60);
    end;
end;
Ich kann Tabellen erstellen. also kann es ja nicht an der Verbindung liegen.

mkinzler 4. Mai 2008 19:26

Re: You have an error in your SQL syntax; 'shell> mysqldu
 
Dass könnte daran liegen, das das kein SQL ist. Es handelt sich hier um einen Aufruf eines Kommandozeilentools

Deltachaos 4. Mai 2008 20:52

Re: You have an error in your SQL syntax; 'shell> mysqldu
 
Zitat:

Zitat von mkinzler
Dass könnte daran liegen, das das kein SQL ist. Es handelt sich hier um einen Aufruf eines Kommandozeilentools

Es soll ja nor irgendwie ein Backup erstellt werden.
fragt sich wie. ich habe gehört das das so wol gehen soll.
muss ich woll alle tabellen auflisten und dan irgendwie inhalt auslesen und speichern.

mkinzler 4. Mai 2008 20:53

Re: You have an error in your SQL syntax; 'shell> mysqldu
 
Externe Programme kannst du per ShellExecute() aufrufen

Deltachaos 6. Mai 2008 17:11

Re: You have an error in your SQL syntax; 'shell> mysqldu
 
Zitat:

Zitat von mkinzler
Externe Programme kannst du per ShellExecute() aufrufen

Is mir klar aber das Backup-Programm das ich schreibe leuft nicht auf dem MySQL server sondern baut nur eib´ne verbindung mit einer Datenbank auf.

Ich muss irgendwie alle Tabellen auslesen und abspeichern.

mkinzler 6. Mai 2008 17:41

Re: You have an error in your SQL syntax; 'shell> mysqldu
 
Dann musst du dies in SQL unter Zuhilfenahme der Systemtabellen machen


Alle Zeitangaben in WEZ +1. Es ist jetzt 22:12 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz