The invention discloses an application of an A-ring trihydroxyl substituted pentacyclic triterpene compound to preparation of an antibacterial or anti-tobacco mosaic virus drug. The general formula of the compound is as shown in the specification, wherein hydroxyls of C1, C2 and C3 are respectively in alpha configuration or beta configuration; R1 and R2 are selected from hydrogen or methyl and are different from each other; R3 is selected from -COOH, -CH2OH, -CHO, -COOR1, -CONH2, -CONHR1 and -CONR1R2; R1 and R2 are selected from alkyl containing 1-15 carbon atoms, substituted or unsubstituted phenyl and substituted or unsubstituted phenyl alkyl; and the substituent group is selected from halogen, hydroxyl, cyan, amino, nitryl, sulfydryl or phenyl, acyl, aryl, alkoxy and alkyl containing 1-15 carbon atoms. The compounds have antibacterial or anti-tobacco mosaic virus activity, have extremely high bacteriostatic activity especially to gram positive bacteria, phytophthora nicotiana and tobacco mosaic virus, and have a good application prospect in fields of medicines and pesticides.