What is magnesium chloride and sodium chloride?

Magnesium chloride(MgCl2 ) is a salt of magnesium. Sodium chloride(NaCl) is a salt of sodium.