Abstract:2-(Dimethylamino)ethyl methacrylate has excellent properties of non-toxicity and degradability, but little research has been done on the direction of corrosion inhibitors. In this paper, two kinds of quaternary ammonium salts (DMA-1 and DMA-2) were synthesized by using 2-(Dimethylamino)ethyl methacrylate as the matrix and chloropropene and benzyl chloride as bridging groups. The obtained product was con-firmed to be consistent with the design by infrared spectroscopy and nuclear magnetic resonance spec-troscopy. Then, the corrosion inhibition performance of Q235 steel in 1 mol/L hydrochloric acid contain-ing DMA-1 and DMA-2 was tested by weight loss experiment, electrochemical experiment, AFM and con-tact angle. And their adsorption and corrosion inhibition mechanisms on the surface of Q235 steel were discussed. The results show that at higher temperatures, DMA-1 and DMA-2 can still be firmly adsorbed on the surface of Q235 steel, and when the concentration of corrosion inhibitor added is 100 mg/L, the corrosion inhibition rate can still reach 92.7% or more. So it shows good corrosion inhibition performance, and DMA-1 has better corrosion inhibition effect than DMA-2. The thermodynamic calculation results show that the adsorption of DMA-1 and DMA-2 on the surface of Q235 steel is chemical adsorption, the process is spontaneous and exothermic, and it is consistent with Langmuir isotherm adsorption. It is a good anode type corrosion inhibitor. Frontier chemical calculations show that DMA-1 is easier to provide or accept electrons, and further study the molecular structure and active sites of DMA-1 and DMA-2.