开发者

Mysqldump with empty result in gzip?

开发者 https://www.devze.com 2022-12-16 17:12 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消