Question: Can any one tell me the query to know data base name already exists or not in mysq.

Thank You

Answer: 
Instead of `Temp` use your DB name.

```
SELECT IF(EXISTS (SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'Temp'), 'Yes','No') 

```
Query INFORMATION\_SCHEMA.SCHEMATA to know if the database exists or not. Read more here - <http://dev.mysql.com/doc/refman/5.0/en/schemata-table.html>