mysqllearner
mysqllearner

Reputation: 13903

Mysqldump with empty result in gzip?

When I output my MySQL Dump Regularly, it outputs a 30MB File. When I use gzip, 0KB.

Here is my code:

$command = "<path to>mysqldump --opt -h $dbhost -u$dbuser -p$dbpass $dbname  | gzip>  test.sql.gz";
system($command);

Result: test.sql.gz 0 KB

---------------------------

$command = "<path to>mysqldump --opt -h $dbhost -u$dbuser -p$dbpass $dbname  > test.sql";
system($command);

Result: test.sql 30 MB

Upvotes: 1

Views: 929

Answers (1)

James
James

Reputation: 8586

Do you need to specify a full path to gzip, instead of just gzip? I'm not sure what your default path will be from within PHP, but it often doesn't cover everything you'd want.

Upvotes: 1

Related Questions