Staphylococcus xylosus (S. xylosus) is one of the emerging pathogens causing bovine mastitis with high rate of isolation in most of the reported clinical and field cases. To verify the role of glutamine synthetase (GS) in the pathogenesis of S. xylosus, we evaluated the virulence level of the wild-type strain and its glnA mutant strain in biofilm assays in vitro and murine infection model in vivo. From the results, it was observed that the glnA mutant strain was attenuated and could reduce tissue damage. 1-Hydroxyanthraquinone (1-HAQ) is a kind of anthraquinones, it exhibited a significant inhibitory effect on the growth of S. xylosus and biofilm formation in vitro and provided anti-inflammatory effects in vivo. In addition, the rate at which it inhibits the biofilm, inflammatory factors, and CFU of wild-type strains were significantly higher than that of the mutant strains, indicating that 1-hAQ might have pharmacological effects against S. xylosus through the regulation of GS protein. The effect of 1-hAQ on GS was further confirmed by the down-regulation of glnA expression, reduced GS activity, Gln content and the results of molecular docking. Taken together, these findings suggest that 1-hAQ facilitated a significant attenuation of S. xylosus pathogenicity by regulating the GS protein: a vital virulence factor. Therefore, it can be inferred that 1-hAQ may serve as a potential source of organic compound for the development of novel alternative drugs in mitigating the menace of bovine mastitis.