Last active
March 26, 2023 15:18
-
-
Save carltondickson/b14d72d9d3631f870c48 to your computer and use it in GitHub Desktop.
mysqldump export and zip
This file contains hidden or 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