The chemical formula of magnesium burning in oxygen is 2Mg+O=ignition=2MgO. The phenomenon that occurs is combustion, which emits dazzling white light, releases heat, and produces white powder. Of course, magnesium can also react in the air and burn, because there is also oxygen in the air.
What substances can magnesium react with
Magnesium is combined with some active non-metallic elements, such as non-metallic elemental Cl2, S, O2. For example, when magnesium burns in air, it mainly reacts with oxygen, and some magnesium reacts with nitrogen in the air: 2Mg + O2 = ignition = 2MgO 3Mg + N2 = ignition = Mg3N2.
As long as H+ can be provided in the solution, the above reaction can occur with magnesium. Strong acid and weak base salts will also supply H+ in aqueous solution due to hydrolysis, and the aqueous solution is acidic. If magnesium is added to the strong acid and weak base salt solution, since the magnesium will consume H+, the hydrolysis of the strong acid and weak base salt will proceed forward, and the hydrolysis will be almost complete. If metal magnesium is added to the solution of ammonium chloride, the reaction is as follows: Mg + 2NH4Cl + 2H2O = MgCl2 + 2 NH3*H2O + H2↑.