Added exception handling to database creation and deletion. Fixes #8075.
Merge pull request #8092 from ghjm/mysql-exceptions

Added exception handling to database creation and deletion. Fixes #8075.