Micro‐arc oxidation (MAO) technology is used to prepare a micro‐arc oxidation coating on the surface of magnesium alloy, and then self‐assembly membrane (SAM) technology is used to separately apply ethyl acetate, cetyltrimethoxysilane, and stearic acid to the MAO coatings. Hydrophilic, hydrophobic, and super‐hydrophobic micro‐arc oxidation/self‐assembly coatings are prepared on the surface of magnesium alloy. The surface morphology, composition, hydrophobicity, and corrosion resistance of the coating are characterized by scanning electron microscope (SEM), X‐Ray diffraction (XRD), contact angle, electrochemical test, and salt spray experiment. The results show that the contact angles of the three types of composite coating are 5.13°, 90.72°, and 150.62°, respectively. As the hydrophobicity of the composite coating increases, the corrosion resistance of the sample gradually increases. Rct is increased from 1.61 × 103 to 3.22 × 106 Ω cm2 and Icorr is reduced from 1.883 × 10−3 to 4.780 × 10−7 A cm−2. The adsorption mode of the coating is further judged by molecular dynamics calculation, and the results show that the three self‐assembled molecules and MgO belong to chemical adsorption.