When restoring a database from sql file, if you come across the error as,
mysql db < dbbbb.sql
=-=-=-=-=-=-=-=
ERROR 1007 (HY000) at line 21: Can't create database 'db'; database exists
Here. open the sql file using vim,
ie vim dbbbb.sql
and comment the line,
#create database db ...
Now, restore the db using the command,
mysql db < dbbbb.sql
This will work.
Done
mysql db < dbbbb.sql
=-=-=-=-=-=-=-=
ERROR 1007 (HY000) at line 21: Can't create database 'db'; database exists
Here. open the sql file using vim,
ie vim dbbbb.sql
and comment the line,
#create database db ...
Now, restore the db using the command,
mysql db < dbbbb.sql
This will work.
Done