Last active
April 7, 2022 09:50
-
-
Save manishprajapatidev/306e71dcf4e15fcdf04f5a2f395ea36b to your computer and use it in GitHub Desktop.
Export Small or Large Database into Single SQL file
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
#1. Export Database | |
mysqldump --host=YOUR_HOST --port=3306 --default-character-set=utf8 --user=YOUR_USERNAME --protocol=tcp --column-statistics=FALSE --skip-triggers "DB_NAME" | |
#Enter Password | |
#2. Export Database in Zipped Format if your database is too large. | |
mysqldump -h YOUR_HOST --set-gtid-purged=OFF -u YOUR_USERNAME -p DB_NAME | gzip > DB_NAME.sql.gz | |
#Enter Password | |
#3. Import Database from Zipped Database (Ubuntu) | |
gunzip < DB_NAME.sql.gz | mysql -h YOUR_HOST -u YOUR_USERNAME -p DB_NAME | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment