J.R. S. answered 09/12/20
Ph.D. University Professor with 10+ years Tutoring Experience
Since the question states that you are using an aqueous solution of MgCl2, you will have present, H2O, H+, Mg2+ and Cl-
Anode: 2Cl- ==> Cl2 + 2e- + H2O ==> ClO- + 2H+ + Cl- (will occur)
Cathode: 2H+ + 2e- ==> H2 (will occur)
Cathode: Mg2+ + 2e- ==> Mg (will not occur)
The deposition of solid Mg will not occur because in aqueous solution, H+ will be reduced before Mg2+ (see reduction potentials for H+ vs. Mg2+)