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
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.
精彩评论