Potential solution to MySQL connection lost error