Make sure that cmake doesn't fail when MySQL libraries are missing

fixes #6665