Running MySQL Utility Commands on Remote Server

Sarah Reichelt sarahr at genesearch.com.au
Mon Mar 28 23:20:28 EST 2005


> In order to do various forms of database maintenance (dumping, 
> importing copying, etc.) I need to be able to use not just the MySQL 
> server commands but also the MySQL utility commands such as mysqldump. 
>  In particular, I'd like to be able to dump the structure and contents 
> of a database on the server into a local file (as a SQL script) on the 
> client system.
>
I do this by including a copy of mysqldmp in with the application. In 
Standalone setttings, in the Copy file section, add the mysqldump file 
to the list and it will automatically become part of your application 
and be useable by the app. With OS X, it is inside the bundle. For 
testing purposes, I put a copy of mysqldump in the folder with the 
stack file.

Here is the script I use:

   put the fileName of stack "MailOpener" into tPath
   set the itemDel to "/"
   put "mysqldump" into last item of tPath
   put "'" & tPath & "' --host='" & dbAddr & \
   "' MailingList names address flags topics deletions" into tCmd
   put " --user='" & dbUser after tCmd
   put "' --password='" & dbPass after tCmd
   put "' -a -l -r '" & tFile & "'" after tCmd

   get shell(tCmd)

Cheers,
Sarah



More information about the use-livecode mailing list