Split out the mysql check. Needs review!