Genetic variation in CLDN19, CNNM2, FXYD2, SLC41A2, and TRPM6 significantly influenced diabetes risk (p < 0.05), and for CNNM2, FXYD2, SLC41A2 and TRPM6 this risk was completely mediated by serum magnesium levels. The gene discussed is CLDN19; the disease is diabetes mellitus.