View Single Post

  #5 (permalink)  
Old 04-18-2008
?manu*
 
Posts: n/a
Default Re: Scripting a backup by phpMyAdmin, or the equivalent?

Jonathan Sachs wrote:
> I found mysqldump, which turned out to be a utility in MySQL's own
> private environment rather than an application that I can put directly
> in a batch file.


You can put it in an batch, only you have to specify its full path, or
you have to add its path to the %PATH environment variable.

> I found documentation which explains how to run mysqldump, but which
> requires me to dig out details of several technical things that I've
> not encountered before. (When is an option preceded by a double
> hyphen? What does '-p' followed by no password mean?)


It means that it will prompt for the password. If your database is only
accessible with password you need your script to know the password. In
this case you can write

mysqldump database --user=the_username --password=the_password > out.sql

where "the_username" and "the_password" are the actual credential to
access the database and "database" is the name of the database.
"out.sql" is the file where the dump is written to.

> Then I'll have to figure out how to run the monitor from a script, and
> then how to run mysqldump from a script inside the monitor.


I don't know what is the monitor. I suppose you can run mysqldump
directly. Try it first from the command line: "start->exec... cmd"

E.
Reply With Quote