Run this in the folder where you want the files dumped:
for I in $(mysql -uroot -p -e 'show databases' -s --skip-column-names); do mysqldump $I > "$I.sql"; done
Run this in the folder where you want the files dumped:
for I in $(mysql -uroot -p -e 'show databases' -s --skip-column-names); do mysqldump $I > "$I.sql"; done