I've written a script which backups my MySQL database and produces a GZIP file with the mysql dump of my database. I wondered if it's possible to decompress the GZIP file and restore the database in one single command?
Something like this:
mysql -u user -h host -ppass database < gzip -c database.backup
But this doesn't seem to work. Any suggestions?
I use the following command:
mysqldump -u user -h host -ppass database | gzip -9 > database.backup
The error I get is: -bash: gzip: No such file or directory;
which, in my opinion, indicates that it does not recognise gzip as a command or something like that
database.backup
file doesn't exist. Are you sure it's there?