mySQL & RR question

Ken Ray kray at sonsothunder.com
Thu Aug 31 15:03:49 EDT 2006


On 8/31/06 12:34 PM, "Ton Kuypers" <tkuypers at dmp-int.com> wrote:

> Hi gang,
> 
> I have created a few (and still more coming up) client-server
> applications using RR and mySQL, but now I am in need for a way to to
> create a back-up possibility for remote databases...
> The clients are Macs and PC's, the servers running the database
> Server can be Windows or Mac
> 
> I need to create a dump of the whole database, including all table
> descriptions and content.
> Anyone any idea what to do, to get a dump of the database on one of
> the remote administrator desktops, or on my own development Mac, to
> have a local copy of the database?

It's really simple - you just need to use shell() to call on the mysqldump
command line utility. For example, if you want to dump a database called
"test" to a file at "/Users/ken/test.sql" you'd execut this at the command
line (assuming a login of "root" and no password):

  mysqldump -u root test > /Users/ken/test.sql

Depending on the size of the database this can take anything from a few
seconds to several minutes. To give you an idea, I routinely "dump" a
database with hundreds of thousands of records to a 250MB .sql file and it
takes about 8 minutes.

If you execute this manually in the console (Terminal in OS X or "DOS box"
in Windows), you will know that it has completed when you get another
command line prompt. You can, of course, execute it from Rev with shell(),
in which case you won't get control back until the dump has finished.

HTH,

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list