Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
mysqldump export and zip
# Exporting entire database:
mysqldump -u user -p database --opt | gzip > database.sql.gz
# Export table
mysqldump -uroot --opt --databases DB_NAME --tables TABLE_NAME | gzip > /tmp/TABLE_NAME.export.sql.gz
# Importing:
gunzip < database.sql.gz | mysql -u user -p database
# Credit
Copy link

uacode commented Oct 27, 2020


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment