I have 200+ mysql database dump in tar.gz format. Restoring all of them one by one is very time consuming. Is there any way so I can restore all these database in a single transaction.
Thanks for your help in advance!
|
I have 200+ mysql database dump in tar.gz format. Restoring all of them one by one is very time consuming. Is there any way so I can restore all these database in a single transaction. Thanks for your help in advance!
| ||||
|
feedback
|
|
With bash: for file in *.tar.gz; do echo "processing $file"; zcat $file | mysql; done | |||||||||||||
feedback
|
|
No, because transactions don't cross database boundaries. On the other hand, if you want to load 200+ databases with a single command, just script the process. | |||
|
feedback
|
zcat $file | mysqlin a loop would have done the trick. – SamKrieg Jul 22 '11 at 14:30