Application of plant artificial cultivation substrates lead to alteration of rhizosphere environment. Whether this alteration could lead to root microbiome variation was limitedly investigated. This work aims to determine the diversity shifts in the root microbiome of cucumber under different plant cultivation substrates and predict corresponding function of these different root bacterial microbiota. Cucumber root samples cultivated with two artificial cultivation substrates and greenhouse soils were prepared. Subsequently, high throughput sequencing and bioinformatics analysis were applicated to compare the root bacterial diversity of cucumber cultivated in different substrates and their corresponding function. In total, 311,039 sequences were obtained, and they were annotated to 42 operational taxonomic units (OTUs), belonging to 28 genera, 18 families, 12 orders, four classes, and three phyla. The α and β diversity of samples from the two cultivation substrates and greenhouse soils were significantly different. Only 2–3 bacterial species were found to be discrepancy between cucumber root samples from artificial cultivation substrates and from greenhouse soils. The relative abundance of genus Asticcacaulis, Methylophilus, Massilia, Dyella, and Devosia in samples of artificial cultivation substrates was significantly higher than that of soils, while the relative abundance of genus Phenylobacterium, Noviherbaspirillum, and Arenimonas was significantly lower than that of soils. Besides, compared to cucumber root bacterial community cultivated in soils, the abundance of synthetic pathways for flavonoids and flavonols, bile acids, indole alkaloids, lactose, and neolactose increased by 41.6-, 28.7-, 5.9-, and 5.5-fold, respectively, in the bacterial community of the substrate 1-cultivated roots, and the abundance of clavulanic acid, receptor interaction, sesquiterpenoid, bile acid, flavonoid and flavonol, indole alkaloid, lactose, and neolactose synthetic pathways increased by 42.3-, 32.4-, 32.4-, 13.9-, 10.3-, 6.3-, and 5.2-fold, respectively, in the bacterial community of the substrate two-cultivated roots. This paper verified the diversity shifts in the root microbiome of cucumber under different plant cultivation substrates. Besides, the corresponding function difference of these different root bacterial microbiota was predicted. This work would provide theoretical support for discovering microbial resources and building artificial microbial flora.