Re: Re: MySQL back up
| From: | Ken | Date: | Fri, 11 Oct 2002 02:39:31 +0000 |
| Subject: | Re: Re: MySQL back up | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-119594@lists.php.net to get a copy of this message | ||
Okay, I took out all the reason for error, I took the variables out of the
code and replaced them with the actual values. I do not execute the gzip
function. All I get is an empty file. Also I made sure the back up directory
is set to 777.
Now phpMySQLAdmin will perform the same function, so there must be a way to
do this without the phpMySQLAdmin program? Has anyone tried to do what I am
trying to do? Has anyone tried with this code?
One more thing, I borrowed a free script written in perl that uses mysqldump
and it worked. The point here is that I want this to work in PHP so I can
include this code in a bigger application I am writing.
Thanks for all your ideas!
"John W. Holmes" <holmes072000@charter.net> wrote in message
news:000001c27058$c1770170$7c02a8c0@coconut...
> > Okay here is the new code and this is still not working.
> >
> > <?php
> >
> > require("./config.php");
> >
> > $sqlserver = $server1;
> > $sqlusername = $username1;
> > $sqlpassword = $password1;
> > $sqldatabase = $database1;
> >
> > //******************************
> > $nam_bak=date('D,d-m-Y');
>
> Can you have a filename with a comma in it?
>
> > exec("mysqldump -u\"$sqlusername\" -p\"$sqlpassword\"
> > \"$sqldatabase\"
> >
> > $backupdir/$nam.sql");
>
> Take out the \" quotes around username, password, and database.
>
> >
> > exec("gzip $backupdir/$nam.sql");
>
> ---John Holmes...
>
>