The mechanical properties and strength formation mechanism of cement–fly-ash-stabilized slag–coal gangue mixture were examined using an unconfined compressive strength test, splitting strength test, triaxial test, and scanning electron microscopy to solve the limitations of land occupation and environmental pollution that is caused by fly ash from the Xixia District thermal power plant in Yinchuan, slag from the Ningdong slag yard, and washed coal gangue. Its performance as a pavement base mixture on the road was investigated. The results demonstrated that as the slag replacement rate increased, the maximum water content increased while the maximum dry density decreased. The addition of slag reduced the unconfined compressive strength and splitting strength of the specimens; furthermore, the higher the slag substitution rate, the lower the unconfined compressive strength and splitting strength of the specimens. As the cement content increased, the specimen’s unconfined compressive strength increased. Based on the principle of considering the mechanical properties and economic concerns, the slag replacement rate in the actual construction should be ~50% and should not exceed 75%. Based on the relationship between the compressive strength and splitting strength of ordinary concrete, the relationship model between the unconfined compressive strength and splitting strength of cement–fly-ash-stabilized slag–coal gangue was established. The failure mode, stress–strain curve, peak stress, and failure criterion of these specimens were analyzed based on the triaxial test results, and the relationship formulas between the slag substitution rate, cement content, peak stress, and confining pressure were fitted. As per the SEM results, the mixture’s hydration products primarily included amorphous colloidal C-S-H, needle rod ettringite AFt, unhydrated cement clinker particles, and fly ash particles. The analysis of the mixture’s strength formation mechanism showed that the mixture’s strength was the comprehensive embodiment of all factors, such as the microaggregate effect, secondary hydration reaction, and material characteristics.