The inhibitive action of some azoles (1,2,4-triazole, 1,2,3-benzotriazole, 5-chlorobenzotriazole, and IFKhAN-92 corrosion inhibitor) on the corrosion of magnesium was investigated in aqueous buffer solutions and humid atmosphere. Increasing the hydrophobicity and decreasing the pK a of NH-acids enhance the protection of Mg by triazoles, that is why 5-chlorobenzotriazole and IFKhAN-92 -a mixture of substituted triazoles -are more efficient inhibitors. Small additions of dioctylphosphate increase the protection of Mg in aqueous solution by IFKhAN-92 inhibitor, and addition of trialkoxysilane to the mixed inhibitor allows one to enhance the protection of Mg in a humid atmosphere.