Planting the economically sustainable Cajanus cajan crop in coal gangue dump as an approach for ecological management has attracted extensive attention from scholars worldwide. Microorganisms play important roles in ecological restoration. However, there have been few reports about the microbial composition and functions of Cajanus cajan root systems planted in plateau waste dumps. In this study, the gangue dump (1,390 m above sea level) in Guizhou Plateau was covered with soil and planted with YN and JX Cajanus cajans. After one year, the Cajanus cajan root system was collected, and high-throughput sequencing was utilized to examine the bacterial and fungal biodiversity. The bacteria in all samples were assigned to six phyla and 60 genera. The unclassified_f_Enterobacteriaceae and Cedecea were the most abundant genera. The fungi were assigned to six phyla and 143 genera and Fusarium was the most abundant genus. Venn and heatmap analyses revealed differences in the dominant root species among Cajanus cajan varieties, Lactococcus and Fusarium. In JX and YN, Pseudoarthrobacter is a unique genus of bacteria; in JX, Robillarda is a unique genus of fungi; and in YN, Scytalidium is a unique genus of fungi. The endophytic fungi mainly play the roles of saprotroph, plant pathogen, and endophyte. Among the bacterial properties, L-arabinose isomerase and adenosine triphosphatase were the most abundant in all samples, while chitinase, catalase, and laccase played important roles in photosynthesis, degradation of lignin, chitin, and chitosan. This study guides the selection of reclamation plants and strategies for the migration and restriction of heavy metals in soil.