Mysql – Extract one MySQL database from a FULL MYSQL Server backup file

backupmysql-5.1restore

I have a small shared windows server on which i'have installed MySQL 5.1 engine for hosting my user's mysql databases.

I backup the complete MySQL databases each day by running this script as batch file in SCHEDULED TASKS:

"C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqldump.exe" -uroot -p"**********" --force --flush-logs --all-databases > c:\dbbackup\alldatabases.sql

So alldatabases.sql will be a SQL file which contains the complete data of MySQL server which can be restored on cases that all of the databases are lost or migrating to another server.

I have never extracted one specific mysql database from this "alldatabases.sql" backup file and i don't have any clue on this.

**The must idiot solution is to restore this big backup file in another server and then simply create an individual backup from a specific database.

Could you help me on extracting one specific MySQL database from this big backup file?
Lets say that MySQL database name is JOOMLAdb

** Also do you have any idea on changing my backup script, so instead of having a big backup file i may have individual backups for each database (Databases will increase/decrease through the time and we don't have a fix list of available databases)
Thank you for your care

Best Regards

Best Answer

Your same question seems to be answered here:

https://stackoverflow.com/questions/2342356/import-single-database-from-all-databases-dump

And as far as an improved backup script, here's what I'm currently using for several years and it rocks:

http://sourceforge.net/projects/automysqlbackup/