Improve MySQL compatibility

Use `exec_query` instead of `execute` so that queries against a MySQL database return a hash instead of an array. This change doesn't affect PostgreSQL compatibility.