mysqldump and OS X

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Wonder if anyone out there can help?

I'm trying to execute a mysql dump on my local Mac (running 10.4), and I'm running into an odd problem, possibly something to do with permissions or $PATH setup.

Here's the code...

<?php

  $dbhost = 'localhost';
  $dbuser = 'user';
  $dbpass = 'blah';
  $dbname = 'property_rental';

  $filepath = $HTTP_SERVER_VARS['DOCUMENT_ROOT'];

  $filename = "$filepath/data.sql";

passthru("mysqldump --opt -h$dbhost -u$dbuser -p$dbpass $dbname > $filename");

?>

Now, if I execute this on the remote server, with the correct login details, it all works tickety-boo. If I execute it locally on my Mac using the built-in Apache server and a localhost address. But if I change the passthru call to an echo, and then copy and past the result into the terminal app, it works. What am I doing wrong? Any ideas greatfully received.

R

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux