zcat/gzcat works in linux, not on osx. general linux/osx compatibility

You are right. It's annoying behavior.

$ zcat foo.txt.gz 
zcat: can't stat: foo.txt.gz (foo.txt.gz.Z): No such file or directory

Try this:

$ zcat < foo.txt.gz 
asdfadsf

I know this is an old question. However, I found a solution from an even older github thread.

You can simply use gunzip -c that works similar to zcat without the errors on Mac OS X.

$ gunzip -c 20150707_backup.sql.gz | mysql -u mysql_user -p