It is very important to clarify the optimization method of the rock-like material ratio for accurately characterizing mechanical properties similar to the original rock. In order to explore the optimal ratio of rock-like materials in gneissic granite, the water–paste ratio, iron powder content and coarse sand content were selected as the influencing factors of the ratio. An orthogonal test design and sensitivity analysis of variance were used to obtain the significant influencing factors of the ratio factors on seven macroscopic mechanical parameters, including compressive strength σc, tensile strength σt, shear strength τf, elastic modulus E, Poisson’s ratio ν, internal friction angle φ and cohesion c. A multivariate linear regression equation was constructed to obtain the quantitative relationship between the significant ratio factors and the macroscopic mechanical parameters. Finally, a rock-like material ratio optimization program based on genetic algorithm inversion was written. The results show that the water–paste ratio had extremely significant effects on σc, σt, τf, E, ν and c. The iron powder content had a highly significant effect on σc, σt, τf and c, and it had a significant effect on ν and φ. Coarse sand content had a significant effect on σc, E and c. The multiple linear regression model has good reliability after testing, which can provide theoretical support for predicting the macroscopic mechanical parameters of rock-like materials to a certain extent. After testing, the ratio optimization program works well. When the water–paste ratio is 0.5325, the iron powder content is 3.975% and the coarse sand content is 15.967%, it is the optimal ratio of rock-like materials.