Last active
August 25, 2020 21:08
-
-
Save JNajera/82decd72cb9286e982db286a7ba7ded0 to your computer and use it in GitHub Desktop.
Docker Expoert and Import DB Mysql
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
| # Backup | |
| docker exec $(docker ps | grep "mysql" | awk '$6 >= 8 {print $1}') /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql |
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
| # Restore | |
| cat backup.sql | docker exec -i $(docker ps | grep "mysql" | awk '$6 >= 8 {print $1}') /usr/bin/mysql -u root --password=root DATABASE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment