Proper error handling when database is not running
Merge pull request #188 from Masadow/mysqlFix

Proper error handling when database is not running.
Close#152