mysqldump export and zip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
--skip-lock-tables