#!/bin/bash
db=`mysql -uroot -p123456 -e "show databases"|egrep -v "mysql|information_schema|performance_schema"|grep -v "Database"`
for line in $db:
do
mysqldump -uroot -p123456 $line > $line.sql
done
原文:https://www.cnblogs.com/sanduzxcvbnm/p/14591700.html