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

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

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -