Re: Newbie Question: mysqldump via PHP
| From: | Tony Frasketi | Date: | Tue, 04 Sep 2001 18:53:10 +0000 |
| Subject: | Re: Newbie Question: mysqldump via PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-65923@lists.php.net to get a copy of this message | ||
Hi Sam
No I haven't tried this since I'm on a virtual server and don't know
where mysqldump is located. I tried doing a phpinfo() to see if I could
get the mysqldump location from there but I didn't see it in the mysql
section of the phpinfo listing. Do you know of a unix shell command I
could use to get the location of mysqldump?
Tony
Sam Masiello wrote:
>
> Have you tried putting in the fully qualified pathname to the mysqldump
> executable?
>
> /usr/somepath/mysqldump <rest of your command here>
>
> HTH
>
> Sam Masiello
> Software Quality Assurance Engineer
> Synacor
> (716) 853-1362 X289
> smasiello@synacor.com
>
> -----Original Message-----
> From: Tony Frasketi [mailto:webmaster@spacecovers.com]
> Sent: Tuesday, September 04, 2001 2:28 PM
> To: Sam Masiello
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] Newbie Question: mysqldump via PHP
>
> Hi Sam
> Thanks for the reply. I had the permission set for 777 so that should
> allow access to the directory for writing from PHP, should it not?
>
> Also I tried specifying >/tmp/db.dump in the command and had the tmp
> directory permission also set for 777 but still get same results. The
> file get written but it's still set to zero bytes.
>
> Any other suggestions would be greatly appreciated.
>
> Sam Masiello wrote:
> >
> > I would say that you have a permission problem with where PHP is
> trying
> > to write the file to. Try outputting the file to /tmp/db.dump and see
> > if you have the same problem.
> >
> > HTH
> >
> > Sam Masiello
> > Software Quality Assurance Engineer
> > Synacor
> > (716) 853-1362 X289
> > smasiello@synacor.com
> >
> > -----Original Message-----
> > From: Tony Frasketi [mailto:webmaster@spacecovers.com]
> > Sent: Tuesday, September 04, 2001 1:56 PM
> > To: php-general@lists.php.net
> > Subject: [PHP] Newbie Question: mysqldump via PHP
> >
> > Hello listers
> >
> > I'm trying to implement a mySQL database dump via PHP4 on a unix
> system
> > as follows...
> >
> > ------------------------------------------------------
> > $result = exec("mysqldump -umyname --password=mypassword
> > tablename >db.dump",$xarray,$status);
> > echo "status[$status]<br>";
> > ------------------------------------------------------
> >
> > I get the following error PHP error message...
> >
> > status[127]
> >
> > and the file 'db.dump' has been created but it has 0 bytes.
> >
> > -rw-r--r-- 1 nobody nobody 0 Sep 4 13:27 db.dump
> >
> > Although I can execute the mysqldump program from the unix shell and I
> > get...
> >
> > -rw-r--r-- 1 myname myname 23704 Sep 4 13:18 db.dump
> >
> > My questions are...
> >
> > 1. Can the mysqldump program be executed via PHP or not and if not
> > can you please explain why?
> >
> > 2. Is there another way of doing this via PHP?
> >
> > Thanks in advance
> > Tony Frasketi
> > P.S. Please answer direct, since I'm only subscribed to the digest.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net