Hydroxyapatite (HA) bioactive film is a standard surface modification method for biodegradable Mg alloys. However, the corrosion resistance of HA film prepared before was mediocre, and the preparation process was complicated. In this study, hydroxyapatite film was prepared for the first time on layered double hydroxides (LDHs) coated Mg alloy by hydrothermal method. The structure and composition of LDHs and HA films were analyzed by scanning electron microscopy (SEM), X-ray diffraction (XRD), energy dispersive spectrometer (EDS), Fourier transform infrared (FT-IR) spectroscopy and X-ray photoelectron spectroscopy (XPS). The corrosion resistance and immersion behavior of the films in simulated body fluid (SBF) were investigated by using potentiodynamic polarization curve, electrochemical impedance spectroscopy (EIS) techniques. The effects of different pH and calcium to phosphorus molar ratios (Ca/P ratios) of HA hydrothermal solution were investigated. The experimental results show that HA films appear in petal-like, filamentous and flower-like. The corrosion resistance of the film first increases and then decreases with the pH from weak acid to alkaline. With the increase of the Ca/P ratio, the film is gradually denser, and the protective effect is enhanced. The immersion test results show that after 7 days of immersion, the impedance modulus of the composite film is about 5 × 103 Ω·cm2, which is ten times higher than the single LDHs film. The effects of the pH and Ca/P ratio of the HA hydrothermal solution on the preparation of HA film are simply explained by thermodynamic theory. The Mg-LDHs-HA composite film provide a corrosion protection barrier for Mg substrate and HA film is biologically active. The barrier effect and the mineralization behavior provide a better corrosion protection for Mg substrate.