A preparation method and an application of a three-dimensional interconnected porous magnesium-based material are provided. The method includes steps of: preparing a porous titanium preform or a porous iron preform; introducing a molten magnesium-based metal into the porous titanium preform or the porous iron preform through pressure infiltration, and obtaining a porous magnesium-based material precursor; and washing the porous magnesium-based material precursor, and obtaining the porous magnesium-based material.