Transgenic glyphosate-resistant maize has emerged as a way to expand the use of glyphosate for weed control. Studying the microbiome in the tissues and rhizosphere soil of transgenic plants is vital for understanding the glyphosate-resistant mechanism and optimizing the transgenic design of crops. In our study, the expression of a mutant cp4epsps gene in transgenic maize, which confers tolerance to glyphosate, was performed using the maize variety Xianyu 335 as the genetically modified acceptor line. This transgenic modification did not affect the initial bacterial community in the leaf, stem, or root of maize, but promoted a differential bacterial community in the rhizosphere soil. Under glyphosate application, the abundance of beneficial bacteria involved in N fixation and P solubilization in plant tissues and the rhizosphere soil of glyphosate-resistance maize were higher than those in the glyphosate-sensitive maize. In contrast, the abundance of pathogens had the opposite trend, suggesting that the enhanced health of transgenic maize prevented microbiome deterioration under glyphosate. The re-inoculation of bacterial strains isolated from glyphosate-resistance maize into the leaf and rhizosphere soil of glyphosate-sensitive maize resulted in an enhanced photosynthetic capacity in response to glyphosate, demonstrating the vital role of specific bacteria for glyphosate resistance. Our study provides important evidence of how transgenic maize tolerance to herbicides affects the bacterial communities across the maize niches under glyphosate toxicity.