Tetraena mongolica is a rare and endangered species unique to China. The total number and density of Tetraena mongolica shrubs in desertification areas have experienced a sharp decrease with increases in coal mining activities. However, available information on the T. mongolica rhizosphere soil quality and microbial properties is scarce. Here, we investigated the effect of coal mining on the soil bacterial community and its response to the soil environment in the T. mongolica region. The results showed that the closer to the coal mining area, the lower the vegetation coverage and species diversity. The electrical conductivity (EC) in the contaminated area increased, while the total nitrogen (TN), available phosphorus (AP), available potassium (AK), and soil organic carbon (SOC) decreased. The activity of β-glucosidase, urease, alkaline phosphatase, and catalase further decreased. In addition, the mining area could alter the soil’s bacterial abundance and diversity. The organic pollutant degradation bacteria such as Sphingomonas, Gemmatimonas, Nocardioides, and Gaiella were enriched in the soil, and the carbon-nitrogen cycle was changed. Canonical correspondence analysis (CCA) and Pearson’s correlation coefficients showed that the change in the bacterial community structure was mainly caused by environmental factors such as water content (SWC) and EC. Taken together, these results suggested that open pit mining led to the salinization of the soil, reduction the soil nutrient content and enzyme activity, shifting the rhizosphere soil microbial community structure, and altering the carbon-nitrogen cycle, and the soil quality declined and the growth of T. mongolica was affected in the end. Therefore, the development of green coal mining technology is of great significance to protect the growth of T. mongolica.