Better checking of the connection to the mysql host