The composition and structure of the rhizosphere microbiome is affected by many factors, including soil type, genotype, and cultivation time of the plant. However, the interaction mechanisms among these factors are largely unclear. We use culture-independent 16S rRNA amplicon sequencing to investigate the rhizosphere bacterial composition and the structure of cultivated cucumber Xintaimici (XT) and wild-type cucumber Cucumis sativus var. hardwickii (HD) in four kinds of soils. We found that soil type, cultivation time, and genotype affected the composition and structure of cucumber rhizosphere bacterial communities. Notably, HD showed better physiological features in sandy soil and sandy loam soil than it did in black soil and farm soil at 50 days post-sowing, which was due to its stronger recruitment ability to Nitrospira, Nocardioides, Bacillus, and Gaiella in sandy soil, and more Tumebacillus, Nitrospira, and Paenibacillus in sandy loam soil. Meanwhile, we also found that HD showed a better recruiting capacity for these bacterial genera than XT in both sandy soil and sandy loam soil. Functional predictions indicated that these bacteria might have had stronger root colonization ability and then promoted the growth of cucumbers by enhancing nitrogen metabolism and active metabolite secretion. In this study, our findings provided a better insight into the relationship between cucumber phenotype, genotype, and the rhizosphere bacterial community, which will offer valuable theoretical references for rhizosphere microbiota studies and its future application in agriculture.