Exception handling for MySQL module

Closes #11616