Created
April 16, 2022 14:06
-
-
Save distolma/6fdb2e158ef5fa3e173994b7ffbfa723 to your computer and use it in GitHub Desktop.
mysql_postgresql_backup.sh
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
| # MySQL | |
| ## Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| ## Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
| #PostgreSQL | |
| ## Backup | |
| docker exec -t CONTAINER pg_dumpall -c -U postgres > backup.sql | |
| ## Restore | |
| cat backup.sql | docker exec -i CONTAINER psql -U postgres |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment