A new micro-arc oxidation method with a home-made asymmetric alternating-current (ac) power supply for forming an anti-corrosion ceramic coating on AZ91D magnesium alloy was presented, and two different silicate-based and aluminate-based preparing solutions were introduced to coating formation. The effect of many processing parameters on the growth and performance of the formed ceramic coating was investigated. It was found that the electrolyte concentration, current density, treating time duration and other parameters have significant influence on the coating morphology and anti-corrosion performance. Through the polarization curve test, it showed that the coating oxidized in silicate solution has better corrosion-resistance due to its continuous and compact structure than that formed in aluminate solution. The morphology and microstructure of the coating were analyzed through SEM, XRD technology. The coating consists of two layers, i.e., loose layer and compact layer. The compositions and phase structures varied with electrolytes, and it was found that the micro-arc oxidation coating prepared in silicate solution is composed of MgO and Mg2SiO4, while the coating prepared in aluminate is mainly composed of MgAl2O4.