Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Want to programatically call MYSQLDUMP from VFP9

Status
Not open for further replies.

mbabcock

Programmer
Jul 25, 2006
32
US
My VFP9 app uses a MySQL5 database. I've reviewed the syntax of the MYSQLDUMP command but I'm unsure of how to invoke that from my VFP9 app.

I'd basically like to have a simple option on my app's menu that says "Backup database" whereby my code then runs something like =SQLEXEC(liHandle,"MYSQLDUMP mydatabasename") but that doesn't seem to work.

Ideas?
 
mysqldump, is not a mysql function. Its a command line executable utility. You would have to cal it, as if you were calling an external program and not like a query.



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Ok, I follow you...but what if this client PC is not where the data is hosted? For example, ClientPC runs the app, but it connects to the data on ServerPC. My understanding is that invoking the client would be fine as long as the data is on that box.

 
Well either your app calls mysqldump from the server, or calls it on the client, and connects it to the server to perform the dump.



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Can my client app call a Stored Proc on the server to get it to kick off the backup on itself?

btw--thanks for the link--I had read that before posting but didn't see the part about where it connected to the remote host.
 
I'll let someone else answer that one. My experience with stored procedures is less than nothing.



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
From the MySQL link you provided, I now see the --host option (and -u and -p) so I'm believing that I should simply create a batch file on the fly with this behavior (and then delete it afterwards to ensure that userid/pwd info is NOT seen by strangers):

MYSQL // will put the computer into MySQL mode assuming I've installed MySQL into the client PATH, iirc

MYSQLDUMP --host -uuserid -ppassword mydatabasename

...does that seem logical? Also, I'm wondering about what MySQL rights the user needs to have to run MySQLDUMP. It's the EXECUTE privilege, right? I'm sure there's got to be some security setting to allow/prevent a remote user from doing this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top