Click to See Complete Forum and Search --> : mysqldump | gzip > not working


rogernem
August 12th, 2009, 01:06 PM
In my code:


$command = 'C:\xampp\mysql\bin\mysqldump --host='.$host.' --user='.$user.' --password='.$pass.' --all-databases | gzip > databasebackup.sql.gz';
system($command);


does not work. It creates the file databasebackup.sql.gz but when I try to open it I get "Invalid archive directory"

If I leave just $command = 'C:\xampp\mysql\bin\mysqldump --host='.$host.' --user='.$user.' --password='.$pass.' --all-databases > databasebackup.sql'; it works.
It creates the file databasebackup.sql and I can open it without a problem.

Any ideas what is wrong?

PeejAvery
August 12th, 2009, 02:31 PM
Since you're using XAMPP, that means you don't have Linux and that you cannot use gzip from the command line like that.