Skip to content

Instantly share code, notes, and snippets.

Embed
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 http://failshell.io/mysql/using-gzip-and-gunzip-with-mysql-to-importexport-backups/
@uacode
Copy link

uacode commented Oct 27, 2020

--skip-lock-tables

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