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

_______________________________________________
use-revolution mailing list
[email protected]
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to