MySQLDump and Restore from within Delphi

Forum related to the ZDBC API-Layer

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
mparak
Senior Boarder
Senior Boarder
Posts: 81
Joined: 12.09.2005, 06:51
Location: Durban South Africa
Contact:

MySQLDump and Restore from within Delphi

Post by mparak »

Hi
I recently needed to copy a medium sized table (200 000 records) from a MySQL server to the local MySQL database. My users have no file shares to the server and can access MySQL only. As we could not find a reliable and fast method we resorted to a primitive method of contructing a batch file (text) containing the MysqlDump and restore commands, then executing the batch file and waiting for the successful execution.
This method works remarkably well but I am afraid that one day we will encounter a version of windows that does not support dos calls like this and we will be in trouble.
For those who are asking how we do a mysql dump and restore in one step the answer is a Good trick of using a | to pipe the output of the MySQL dump into the restore process. If anyone is interested in how this is done, I would be glad to help.
Anyhow I am looking for a way of doing this kind of incredibly fast copy from within the Zeos components.

Warmest regards

M Parak
Durban
zippo
Silver Boarder
Silver Boarder
Posts: 322
Joined: 12.10.2005, 18:01
Location: Slovenia

Post by zippo »

I'm using a component called MySQLBackup. Until now I had no problems at all, but I'm not sure if it works with all MySQL versions.
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Hi,

In my opinion this should not bedone using ZEOS components. The tools provided by Mysql just are the best for this kind of operations. It seems very unlikely that commandline supportwill completely disappear from Windows or any other OperatingSystem. And when it disappears there will be somebodywho writes that feature himself (eg the unix-like tools already available).
So my answer is : just don't try to change your winning team.

Zippo, I'm very interested in this MySqlBackup component. Isit freely available? Where?

Mark
Image
mparak
Senior Boarder
Senior Boarder
Posts: 81
Joined: 12.09.2005, 06:51
Location: Durban South Africa
Contact:

Found the MySQLBackup component and busy testing, thanks

Post by mparak »

This link is for mDaems who needed to find the component.

http://www.torry.net/pages.php?id=1170
Post Reply