HA containing coatings were formed on the surface of magnesium alloys by micro-arc oxidation at various coat time. The dense inner layer and porous outer layer structure is proved by a physical method. The failure mechanism of the MAO samples in Hank's solution was studied by long time immersion. A model for corrosion mechanism and corrosion process of the MAO coating on AZ31 Mg alloy in Hank's solution is proposed.