Modification by magnesium oxide(MgO) was successfully introduced into perovskite solar cells to protect perovskite from corrosion by the photo-catalysis of TiO2 under ultraviolet(UV) light. MgO modification was fabricated on mesoporous TiO2 film using a simple method by the oxidation of magnesium acetate and therefore could block the contact between perovskite and TiO2. After radiation under UV light, UV-vis absorption spectra of perovskite with MgO modification revealed an enhanced absorption compared to the un-modificated one, especially in long wavelength range. Besides the photo current, photo-voltage and fill factor also showed an enhancement after modification, resulting in the overall efficiency increasing from 9.9% to 13.2%. With further study, we used found the MgO could increase the bandgap of TiO2 to raise the photo-voltage via UV-vis DRS spectra and the EIS results gave the prove that MgO could act as a insulating layer to reduced charge recombination and therefore increase the fill factor. Thus, the application of MgO as a functional layer between TiO2 and perovskite is a useful strategy to preparing highly efficient hybrid perovskite solar cells with anti corrosion by UV-light, increased photo-voltage and retarded charge recombination. At last, we raised a new mechanism of UV-vis corrosion cooperated with H2O absorbed on TiO2 and further investigation is necessary to understand the inside of the UV light degradation mechanism.