upgraded method that check if a connection with a mysql server could be accomplished