To obtain information on the sanitary condition of indoor environment in greenhouses used for shiitake cultivation, bacteria associated with larvae and imagoes of Sciaridae flies, a pest to shiitake mushroom, were isolated and identified. A total of 1,048 bacterial colonies were isolated from the flies’ larvae and 984 bacterial colonies were isolated from the flies’ imagoes. Based on the molecular analysis of the 16S rDNA sequence, Achromobacter xylosoxidans and Tetrathiobacter kashmirensis of betaproteobacteria, Enterobacter asburiae and Raoultella ornithinolytica of gammaproteobacteria, Curtobacterium sp. and Microbacterium thalassium of Actinobacteria, and Penibacillus taichungensis of Firmicutes were identified from the colonies of the flies’ larvae. On the other hand, Bacillus megaterium, B. thuringiensis, Lysinbacillus sphaericus and L. fusifomis of Firmicutes, Microbacterium thalassium and Citricoccus parietis of Actinobacteria, and Enterobacter asburiae of gammaproteobacteria were identified from the flies’ imagoes. Some of the isolated bacterial species were known to be human pathogens. Overall, the results of this study suggested that mushroom fly carrying human pathogenic bacteria is one of factors affecting the sanitary of indoor environment of greenhouses used for shiitake cultivation.