Unable to connect to database: Lost connection to MySQL server during query