Tag : importing-compressed-mysql-databases

Exporting and Importing Compressed MySQL Databases

This command will dump a MySQL database, compress it and save it to a file (replace userName and databaseName with your data):


mysqldump -u userName -p databaseName | gzip > databaseName.sql.gz

The import command takes a compressed MySQL dump, decompresses it and adds it to the database (replace userName and databaseName with your data):


gzip -dc < databaseName.sql.gz | mysql -u userName -p databaseName