in Articles

Dump MySQL databases to separate files

When I backup MySQL databases, I often use mysqldump and it does its job in a rather pleasant way. Recently I had to restore a table in the SQL database, and I realized that browsing through all that data contained in the dump just to find the correct database and table was a full-time job in itself!

I realized that this procedure could be done in a much simpler way. The best way would be to dump all databases to separate .sql files, and I chose this approach. I hacked together a small script that does exactly that. Bear in mind though if you plan to use it, that the script does no error checking of any kind! This will be done in future revisions tough, but hey, it works.

Download dumpmysqldb.sh