Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MYSQL_USER=root
- MYSQL_PASS=root
- MYSQL_CONN="-u${MYSQL_USER} -p${MYSQL_PASS}"
- #
- # Collect all database names except for
- # mysql, information_schema, and performance_schema
- #
- SQL="SELECT schema_name FROM information_schema.schemata WHERE schema_name NOT IN"
- SQL="${SQL} ('mysql','information_schema','performance_schema')"
- DBLISTFILE=/tmp/DatabasesToDump.txt
- mysql ${MYSQL_CONN} -ANe"${SQL}" > ${DBLISTFILE}
- mkdir dbs
- for DB in `cat ${DBLISTFILE}`;
- do
- echo "Dumping ${DB}";
- /Applications/MAMP/Library/bin/mysqldump ${MYSQL_CONN} --databases ${DB} > dbs/${DB}.sql;
- echo "Dumped ${DB}";
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement