mysqldump -u USER -h localhost -p DBname | gzip > ./DBname.sql mysql -u USER -h localhost -p DBname < ./DBname.sql