The goal of this study was to observe the bacterial colonization in the intestinal mucosa in the patients with diarrhea predominant irritable bowel syndrome (IBS-D) and ulcerative colitis (UC), and compare the mucosa-associated microbiota among the IBS-D patients, UC patients and the healthy control, and explore the correlation of the mucosa-associated microbiota with clinical manifestations. A total of 20 IBS-D patients, 28 patients with UC (16 active, 12 inactive) and 16 healthy subjects were enrolled in the study. They all underwent colonoscopies in the Gastrointestinal Endoscopy Center in the Second Affiliated Hospital of Xi'an Jiaotong University from June 2016 to October 2016. The mucosa specimens were taken at the junction of rectum and sigmoid colon for fluorescent in situ hybridization (FISH). Then the observed mucosa-associated microbiota was counted and compared. (1) In the IBS-D patients, the mucosa-associated bacteria were found to colonize in the surface of mucosa and the adjacent mucin layer. And in active UC, Escherichia coli, and Bacteroides were found in the lamina propria, in addition to bacterial colonization in the above-mentioned areas. (2) The total count of mucosa-associated bacteria and the individual counts of E. coli, Clostridium, and Bacteroides were significantly increased, and Bifidobacteria significantly decreased (P<0.05) in the IBS-D patients and UC patients. Counts of Lactobacillus were decreased only in UC patients compared with the healthy control. And a significantly larger variation of the above-mentioned bacterial counts was found in the patients with UC, particularly in those with active UC, compared with those with IBS-D (P<0.05); the counts in the UC group were 1.3 to 5.3 times more or less than those in the IBS-D group. (3) Compared with healthy controls and IBS-D, the total count of bacteria and the individual counts of E. coli and Bacteroides in the lamina propria in active UC were significantly increased (P<0.05). (4) A significant negative correlation of the counts of Lactobacillus and Bifidobacteria with the defecation frequency and fecal characteristics (P<0.05) was found in the IBS-D patients; in those with UC, both the total count of bacteria and the individual counts of E. coli, Clostridium, Bacteroides, Lactobacillus, and Bifidobacteria were significantly correlated, positively or negatively, with the related clinical manifestations and the activity of the disease (P<0.05). Compared with the healthy control, intestinal microecology was changed most obviously in UC with much smaller differences though in the same direction in IBS-D. The translocation of some bacteria into the lamina propria was found in UC, particularly in active UC. The changes of mucosa-associated microbiota were related more or less to some clinical manifestations in IBS-D and UC.