Casing soil is a key step in the production of Oudemansiella raphanipes. Bacterial community in casing soil plays key roles in the growth and development of edible fungi. However, a knowledge gap remains regarding the bacterial community shifts in casing soil before and after the cultivation of O. raphanipes (CSBACO). Casing soil samples before and after the cultivation of O. raphanipes (CSBC and CSAC) were collected and examined by high-throughput 16S rRNA gene sequencing technology. Actinobacteria, Proteobacteria, Chloroflexi, and Acidobacteria were dominant phyla in casing soil of O. raphanipes, which accounted for 77.32% of the total abundance. After the cultivation of O. raphanipes, the alpha diversity of bacterial community and the relative abundance of some beneficial genera such as Marmoricola, Nocardioides, Sphingomonas, and Streptomyces decreased, while that of bacteria belonging to the candidate class MB-A2-108 tolerant to adverse environment significantly increased. Meanwhile, physicochemical properties of casing soil changed significantly in CSBACO. Soil ammonium nitrogen and organic matter greatly decreased in CSAC and they mainly influenced bacterial community before the cultivation of O. raphanipes. In contrast, available potassium and pH significantly increased in CSAC and mainly affected bacterial community after the cultivation of O. raphanipes. Furthermore, the relative abundance of bacteria with the function of amino acid and lipid metabolism decreased, while that of bacteria functions related to parasites and pathogens increased, which further revealed the significance of bacterial community in casing soil. Diversity, composition, and the potential function of bacterial community shifted dramatically in CSBACO. The results deepen the understanding of the bacterial community and its microecological mechanism in casing soil of O. raphanipes.