Created
September 5, 2017 03:53
-
-
Save MikeiLL/34c995994333cc0abdc2ed44d2e890b2 to your computer and use it in GitHub Desktop.
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
function dumpdb() | |
{ | |
# source https://stackoverflow.com/a/46042938/2223106 | |
# source https://gist.github.com/spalladino/6d981f7b33f6e0afe6bb | |
local wkdir=`basename $PWD` | |
local container='echo ${wkdir}_my-wpdb_1' | |
docker exec ${container} mysqldump -uroot --password=password wordpress > backup.sql | |
} | |
function restoredb() | |
{ | |
# source: https://unix.stackexchange.com/a/390365/68860 | |
local wkdir=`basename $PWD` | |
local container="${wkdir}_my-wpdb_1" | |
cat backup.sql | docker exec -i ${container} /usr/bin/mysql -u root --password=dockerpass wordpress | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment