Re: [PHP] Newbie Question: mysqldump via PHP
ated by ... 77: 78: Default options are read from the following files in the given order: 79: /etc/my.cnf /var/lib/mysql/my.cnf ~/.my.cnf 80: The following groups are read: mysqldump client 81: The following options may be given as the first argument: 82: --print-defaults Print the program argument list and exit 83: --no-defaults Don't read default options from any options file 84: --defaults-file=# Only read default options from the given file # 85: --defaults-extra-file=# Read this file after the global files are read 86: 87: Possible variables for option --set-variable (-O) are: 88: max_allowed_packet current value: 25165824 89: net_buffer_length current value: 1047551 Thanks again! Tony Jason Bell wrote: > > Have you tried storing the mysqldump output to a string and then using PHP > to open a file, dump the string into the file, and then close the file? > > Might work that way... > > - Original Message ----- > From: "Tony Frasketi" <[EMAIL PROTECTED]> > To: "Sam Masiello" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Tuesday, September 04, 2001 12:39 PM > Subject: Re: [PHP] Newbie Question: mysqldump via PHP > > > Hi Sam > > Thanks to suggestions from jason, Alexander, and yourself I tried the > > unix which command and found that mysqldump was located at... > > > >/usr/bin/ directory > > > > And I changed my exec command to include this directory but alas, the > > results were the same. > > > > Is it possible that the mysqldump command cannot be run from PHP under > > user nobody? > > > > Still appreciative of any other ideas I can try! > > Tony F. > > > > Sam Masiello wrote: > > > > > > Have you tried putting in the fully qualified pathname to the mysqldump > > > executable? > > > > > > /usr/somepath/mysqldump > > > > > > HTH > > > > > > Sam Masiello > > > Software Quality Assurance Engineer > > > Synacor > > > (716) 853-1362 X289 > > > [EMAIL PROTECTED] > > > > > > -Original Message- > > > From: Tony Frasketi [mailto:[EMAIL PROTECTED]] > > > Sent: Tuesday, September 04, 2001 2:28 PM > > > To: Sam Masiello > > > Cc: [EMAIL PROTECTED] > > > 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 > > > > [EMAIL PROTECTED] > > > > > > > > -Original Message- > > > > From: Tony Frasketi [mailto:[EMAIL PROTECTED]] > > > > Sent: Tuesday, September 04, 2001 1:56 PM > > > > To: [EMAIL PROTECTED] > > > > 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]"; > > > >-- > > > > > > > > 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.d
Re: [PHP] Newbie Question: mysqldump via PHP
Have you tried storing the mysqldump output to a string and then using PHP to open a file, dump the string into the file, and then close the file? Might work that way... - Original Message - From: "Tony Frasketi" <[EMAIL PROTECTED]> To: "Sam Masiello" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, September 04, 2001 12:39 PM Subject: Re: [PHP] Newbie Question: mysqldump via PHP > Hi Sam > Thanks to suggestions from jason, Alexander, and yourself I tried the > unix which command and found that mysqldump was located at... > >/usr/bin/ directory > > And I changed my exec command to include this directory but alas, the > results were the same. > > Is it possible that the mysqldump command cannot be run from PHP under > user nobody? > > Still appreciative of any other ideas I can try! > Tony F. > > Sam Masiello wrote: > > > > Have you tried putting in the fully qualified pathname to the mysqldump > > executable? > > > > /usr/somepath/mysqldump > > > > HTH > > > > Sam Masiello > > Software Quality Assurance Engineer > > Synacor > > (716) 853-1362 X289 > > [EMAIL PROTECTED] > > > > -Original Message----- > > From: Tony Frasketi [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, September 04, 2001 2:28 PM > > To: Sam Masiello > > Cc: [EMAIL PROTECTED] > > 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 > > > [EMAIL PROTECTED] > > > > > > -Original Message- > > > From: Tony Frasketi [mailto:[EMAIL PROTECTED]] > > > Sent: Tuesday, September 04, 2001 1:56 PM > > > To: [EMAIL PROTECTED] > > > 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]"; > > >-- > > > > > > 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: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: > > [EMAIL PROTECTED] > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Newbie Question: mysqldump via PHP
Hi Sam Thanks to suggestions from jason, Alexander, and yourself I tried the unix which command and found that mysqldump was located at... /usr/bin/ directory And I changed my exec command to include this directory but alas, the results were the same. Is it possible that the mysqldump command cannot be run from PHP under user nobody? Still appreciative of any other ideas I can try! Tony F. Sam Masiello wrote: > > Have you tried putting in the fully qualified pathname to the mysqldump > executable? > > /usr/somepath/mysqldump > > HTH > > Sam Masiello > Software Quality Assurance Engineer > Synacor > (716) 853-1362 X289 > [EMAIL PROTECTED] > > -Original Message- > From: Tony Frasketi [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 04, 2001 2:28 PM > To: Sam Masiello > Cc: [EMAIL PROTECTED] > 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 > > [EMAIL PROTECTED] > > > > -Original Message- > > From: Tony Frasketi [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, September 04, 2001 1:56 PM > > To: [EMAIL PROTECTED] > > 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]"; > >-- > > > > 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: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: > [EMAIL PROTECTED] > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Newbie Question: mysqldump via PHP
So sprach »Tony Frasketi« am 2001-09-04 um 13:53:10 -0500 : > section of the phpinfo listing. Do you know of a unix shell command I > could use to get the location of mysqldump? which mysqldump this should tell you. Alexander Skwar -- How to quote: http://learn.to/quote (german) http://quote.6x.to (english) Homepage: http://www.digitalprojects.com | http://www.iso-top.de iso-top.de - Die günstige Art an Linux Distributionen zu kommen Uptime: 1 day 12 hours 0 minutes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Newbie Question: mysqldump via PHP
the unix command to see where an executable is, is which. Example: "which mysqldump" - Original Message - From: "Tony Frasketi" <[EMAIL PROTECTED]> To: "Sam Masiello" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, September 04, 2001 11:53 AM Subject: Re: [PHP] Newbie Question: mysqldump via PHP > 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 > > > > HTH > > > > Sam Masiello > > Software Quality Assurance Engineer > > Synacor > > (716) 853-1362 X289 > > [EMAIL PROTECTED] > > > > -----Original Message----- > > From: Tony Frasketi [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, September 04, 2001 2:28 PM > > To: Sam Masiello > > Cc: [EMAIL PROTECTED] > > 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 > > > [EMAIL PROTECTED] > > > > > > -Original Message- > > > From: Tony Frasketi [mailto:[EMAIL PROTECTED]] > > > Sent: Tuesday, September 04, 2001 1:56 PM > > > To: [EMAIL PROTECTED] > > > 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]"; > > >-- > > > > > > 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: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: > > [EMAIL PROTECTED] > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Newbie Question: mysqldump via PHP
You could do: "which mysqldump" (without the quotes, of course :) ). This is provided that mysqldump is in your path (if you can enter just "mysqldump" from the command line, then it is). HTH Sam Masiello Software Quality Assurance Engineer Synacor (716) 853-1362 X289 [EMAIL PROTECTED] -Original Message- From: Tony Frasketi [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 04, 2001 2:53 PM To: Sam Masiello Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Newbie Question: mysqldump via PHP 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 > > HTH > > Sam Masiello > Software Quality Assurance Engineer > Synacor > (716) 853-1362 X289 > [EMAIL PROTECTED] > > -Original Message- > From: Tony Frasketi [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 04, 2001 2:28 PM > To: Sam Masiello > Cc: [EMAIL PROTECTED] > 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 > > [EMAIL PROTECTED] > > > > -Original Message- > > From: Tony Frasketi [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, September 04, 2001 1:56 PM > > To: [EMAIL PROTECTED] > > 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]"; > >-- > > > > 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: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: > [EMAIL PROTECTED] > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Newbie Question: mysqldump via PHP
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 > > HTH > > Sam Masiello > Software Quality Assurance Engineer > Synacor > (716) 853-1362 X289 > [EMAIL PROTECTED] > > -Original Message- > From: Tony Frasketi [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 04, 2001 2:28 PM > To: Sam Masiello > Cc: [EMAIL PROTECTED] > 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 > > [EMAIL PROTECTED] > > > > -Original Message- > > From: Tony Frasketi [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, September 04, 2001 1:56 PM > > To: [EMAIL PROTECTED] > > 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]"; > >-- > > > > 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: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: > [EMAIL PROTECTED] > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Newbie Question: mysqldump via PHP
Hi sagar The $xarray,$status parameters are part of the PHP exec command not the embedded mysqldump command. $result = exec("mysqldump -umyname --password=mypassword databsename >db.dump",$xarray,$status); Thanks, Tony sagar wrote: > > did u got it or not ? > recently i used the mysqldump. > > the syntax is as used by me is > > mysqldump [OPTIONS] database [tables] > (destination file); > > i dont know why used $xarray,$status. > > hope u'll clear out > > /sagar > > - Original Message - > From: Tony Frasketi <[EMAIL PROTECTED]> > To: sagar <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Tuesday, September 04, 2001 11:53 PM > Subject: Re: [PHP] Newbie Question: mysqldump via PHP > > > Hi Sagar > > My goof in the email composition! 'tablename' should have been 'dbname'. > > So yes, the database name is specified and I am attempting to dump the > > entire database with all tables. > > > > Thanks for point out my error. > > > > sagar wrote: > > > > > > Did u mention the database name from where the table has to be > > > picked up. > > > > > > check out the manual for correct syntax. > > > > > > /sagar > > > - Original Message - > > > From: Tony Frasketi <[EMAIL PROTECTED]> > > > To: <[EMAIL PROTECTED]> > > > Sent: Tuesday, September 04, 2001 11:25 PM > > > 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]"; > > > >-- > > > > > > > > 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: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > To contact the list administrators, e-mail: > [EMAIL PROTECTED] > > > > > > _ > > > Do You Yahoo!? > > > Get your free @yahoo.com address at http://mail.yahoo.com > > _ > Do You Yahoo!? > Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Newbie Question: mysqldump via PHP
Have you tried putting in the fully qualified pathname to the mysqldump executable? /usr/somepath/mysqldump HTH Sam Masiello Software Quality Assurance Engineer Synacor (716) 853-1362 X289 [EMAIL PROTECTED] -Original Message- From: Tony Frasketi [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 04, 2001 2:28 PM To: Sam Masiello Cc: [EMAIL PROTECTED] 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 > [EMAIL PROTECTED] > > -Original Message- > From: Tony Frasketi [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 04, 2001 1:56 PM > To: [EMAIL PROTECTED] > 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]"; >-- > > 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
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 > [EMAIL PROTECTED] > > -Original Message- > From: Tony Frasketi [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 04, 2001 1:56 PM > To: [EMAIL PROTECTED] > 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]"; >-- > > 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Newbie Question: mysqldump via PHP
Hi Sagar My goof in the email composition! 'tablename' should have been 'dbname'. So yes, the database name is specified and I am attempting to dump the entire database with all tables. Thanks for point out my error. sagar wrote: > > Did u mention the database name from where the table has to be > picked up. > > check out the manual for correct syntax. > > /sagar > - Original Message - > From: Tony Frasketi <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, September 04, 2001 11:25 PM > 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]"; > >-- > > > > 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: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > _ > Do You Yahoo!? > Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Newbie Question: mysqldump via PHP
Did u mention the database name from where the table has to be picked up. check out the manual for correct syntax. /sagar - Original Message - From: Tony Frasketi <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, September 04, 2001 11:25 PM 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]"; >-- > > 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Newbie Question: mysqldump via PHP
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 [EMAIL PROTECTED] -Original Message- From: Tony Frasketi [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 04, 2001 1:56 PM To: [EMAIL PROTECTED] 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]"; -- 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[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]"; -- 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]