Created
March 26, 2014 19:09
-
-
Save JoaoVagner/9790919 to your computer and use it in GitHub Desktop.
dump all mysql databases
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
MYUSERNAME=joao | |
MYPASSWORD=asenha | |
MYHOST=seu_host_aqui | |
# Databases to exclude | |
DBEXCLUDE=db_name_i_dont_want | |
MYSQL=$(mysql -N -u${USER} -p${PASS} -h${HOST} <<<"SHOW DATABASES" | grep -v ${DBEXCLUDE} | grep -v mysql | grep -v information_schema | grep -v test | tr "\n" " ") | |
mysqldump -v -u${USER} -p${PASS} -h${HOST} --databases --skip-lock-tables ${MYSQL} > backup_all.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment