Last active
August 24, 2021 03:22
-
-
Save usayamadx/ff046dfef9ae31c5f85724a261d785bc to your computer and use it in GitHub Desktop.
mysql export/import commands
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
/* ------------- | |
dump : export | |
------------- */ | |
// schema + records | |
mysqldump -u user -p database_name > database_name_`date +%Y%m%d-%H%M%S`.sql | |
// schema | |
mysqldump -u user -p -d database_name > database_name_`date +%Y%m%d-%H%M%S`.sql | |
// tables | |
mysqldump -u user -p -t database_name table_name_a table_name_b > database_name_tables_`date +%Y%m%d-%H%M%S`.sql | |
/* ------------- | |
dump : import | |
------------- */ | |
mysql -u user -p database_name < file_name.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment