A method for preparing waterborne epoxy coating used for an inner compartment of a ship is disclosed. The method includes fully mixing aluminum nitrate, zinc borate, polyvinyl alcohol 6000 and water;adding ammonia water dropwise under stirring until the pH value of the system is 8-8.4; stirring the mixture to obtain a white emulsion suspension; performing a hydrothermal reaction, centrifugation,washing, drying, calcination and cooling to obtain a material a; stirring bisphenol A type epoxy resin, bisphenol F type epoxy resin, epoxy alkyd resin, and trimethylhexamethylenediamine to obtain a material b; and stirring the material b, the material a, nanometer talc powder, vermiculite powder, diatomite, fly ash, zinc oxide, zinc phosphate, polyethylene glycol, a film forming auxiliary agent,an antibacterial agent, a dispersing agent, an anti-mold agent, a defoamer, a wetting agent and water to obtain the coating.