A Little Noise

February 11, 2010

Restore from mysqldump --all-databases in parallel

Filed under: MySQL — snoyes @ 3:12 pm

csplit backup.sql /"^-- Current Database"/ {*}; for f in xx*; do cat xx00 "$f" | mysql& done;

and then rm xx* when the background jobs have finished.

I haven’t done any benchmarking, and I haven’t worked out what to do if the number of databases exceeds the number of available connections.

Powered by WordPress