php - Mysqldump with empty result in gzip? -


when output mysql dump regularly, outputs 30mb file. when use gzip, 0kb.

here 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 

do need specify full path gzip, instead of gzip? i'm not sure default path within php, doesn't cover you'd want.


Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -