Merge pull request #985 from narfbg/develop-db-mysql

Improve the MySQL database driver