Added catch for a failure to connect to MySQL and formatted.