The invention relates to Mulin acetate containing substituted squaric acid and an application thereof which belong to the technical field of medicines, specifically to substituted squaric acid containing Mulin acetate as shown in a general formula (I), pharmaceutically acceptable salt, a hydrate and an isomer thereof, wherein R1, R2, R3, R4, R5 and B are defined in the specification. The invention also relates to a preparation method of these compounds, a pharmaceutical composition containing these compounds and an application of these compounds in the preparation of drugs for treating or preventing bacteria and virus. As for staphylococcus aureus and Streptococcus equin MIC value, the compounds have an antibacterial effect 15-20 times higher than a control commercially-available antibiotic tiamulin in the test. And the compounds provided by the invention are effective antimicrobial agents. And the compounds provided by the invention are effective antimicrobial agents.