The clinical manifestations of pyogenic liver abscess (PLA) vary between patients with and without diabetes mellitus (DM). However, the relationship between PLA and the gut microbiome remains unknown. This study analyzed the composition of gut microbiota in PLA patients with and without DM and healthy controls (HCs) with the goal of identifying potential reasons for the observed variations in clinical manifestations. Patients and Methods: Using 16S ribosomal RNA(16S rRNA) gene sequencing, we analyzed the compositions of gut microbiota in 32 PLA patients with DM, 32 PLA patients without DM, and 29 matched HCs. Results: In PLA patients with DM, the D-dimer level, fibrinogen degradation products, and thrombin time were significantly higher compared to the PLA patients without DM (P < 0.05). The abundance and diversity of intestinal flora were reduced in both groups of PLA patients compared with the HCs (P < 0.05). Specifically, the PLA patients with DM showed significant decreases in the relative abundances of Bacteroides, Blautia, Prevotella9, and Faecalibacterium, whereas Enterococcus and Escherichia-Shigella were relatively more abundant (P < 0.05). Compared to PLA patients without DM, those with DM had lower relative abundances of Lactobacillus and Klebsiella (P < 0.05) and showed different bacterial flora, including Anaerosporobacter and Megamonas. Conclusion: PLA patients with DM exhibited more severe clinical manifestations of PLA compared to patients without DM. It is important to monitor blood coagulation in PLA patients with DM to prevent the development of thrombotic diseases. Additionally, PLA patients with DM exhibit distinct differences in the composition and diversity of their intestinal flora compared to both PLA patients without DM and HCs.