It is not rare situation that I have mysqldump file which contains more than one database. Here is example how you can extract and import just one database from mysqldump file. In this example I will use database zezalica and root password is pillow.

One of possible solutions is to directly import database from mysqldump file.

[root@setenforce ~]# mysql -u root -ppillow --one-database zezalica < database.sql

Also you can create new sql file with just one database backup.

[root@setenforce ~]# sed -n '/^-- Current Database: `zezalica`/,/^-- Current Database: `/p' database.sql > zezalica.sql

Now you should import that dump file. Just one small note, zezalica.sql should be owned by user mysql and group mysql, so I copy that file in /var/lib/mysql and change ownership according that.

[root@setenforce ~]# mysql -u root –ppillow
mysql> use zezalica;
mysql> source /var/lib/mysql/zezalica.sql

Simple as that!