List:MySQL++« Previous MessageNext Message »
From:William Pettersson Date:July 9 2008 10:39am
Subject:Duplicating tables - mysqldump or mysqlpp or?
View as plain text  
Hi all,
The short and dirty question:
I need to replicate 3-4 tables over a network from a remote MySQL 
database to a local MySQL database, from within a (Visual) C++ app.  My 
choices as I see them are
a) Use mysql++, query the remote database first, retrieve all data, then 
reinsert into the local database using mysql++
b) Just call mysqldump as a shell program.
Which would you guys suggest?  Of note is the fact that how long it 
takes me to write is important, so if the mysql++ way is going to take 
longer (which it may, don't know how easily I can convert SELECT output 
into an INSERT statement) then I'd prefer to stick with mysqldump.

Long summary:
For this project, I have a main DB server, and a remote handheld (eeepc) 
client.  The eeepc needs to query a serial device (RFID reader), check 
some stuff in the database and show some info.  The thing is, the eeepc 
won't always have a network connection.  Actually, it rarely will.  So 
what I need to do is synchronise two databases, remote and local, and 
then just have my app query the local database.
I've got the app itself working, and querying the local database, so I 
just need to work on the synchronising bit.  I can either use mysqldump 
(easy, dirty shell command), or pull info in with mysql++, rewrite the 
output as an insert statement, and then reinsert with mysql++.  I don't 
want to waste too much time, so if mysql++ method is going to be too 
hard, I'll just fall back to mysqldump.

William Pettersson

NLT Australia
07 5495 2944
Duplicating tables - mysqldump or mysqlpp or?William Pettersson9 Jul
  • Re: Duplicating tables - mysqldump or mysqlpp or?Warren Young9 Jul
  • Re: Duplicating tables - mysqldump or mysqlpp or?Jonathan Wakely9 Jul
  • RE: Duplicating tables - mysqldump or mysqlpp or?Paul Martin9 Jul
Re: Duplicating tables - mysqldump or mysqlpp or?William Pettersson9 Jul