Last Updated: September 13, 2017
·
168
· ivanhoe011

Oneliner to dump & gzip all MySQL DBs, each in a separate file

From the backup folder run:

mysql -s -r -N -u root -p -e 'show databases where `Database` not in("information_schema","performance_schema")' | while read db; do mysqldump -u root -p $db | gzip > ./${db}.sql.gz; done