Re: mysqldump problem from PHP

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

 





Edward Kay wrote:

Angelo Zanetti wrote:

hi all,

Im doing the following dump through PHP:

$output = shell_exec('mysqldump '. $db_database .' > '.
$backup_path.$filename);

It doesnt seem to work but when I run the exact same command (with
appropriate values) in the command line it creates the dump file. What
could be the reason for this?

Thanks in advance.

regards

It appears that it could be because the user that runs the scripts is
not allowed to. When I run them on the commandline, I run them as the
root user. Is this a common problem? What would the best way be to sort
this out keeping in mind security on the server?

If you are trying to automate backups of you database, set up a cron job. I
have a shell script that dumps my databases, zips them and then sends them
via FTP to a remote server. This is automatically run every 12 hours by
cron.

See http://en.wikipedia.org/wiki/Crontab for more info.

Edward



hi Edward,
yes I know of CRONtabs but wont this still leave us with the user permission of running mysqldump? because essentially it will still be a PHP file to run the shell command to create the dump file?

thanks

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux