In order to study the effect of high temperature on the mechanical properties of rock, two groups of coarse sandstone samples were subjected to the uniaxial compression and triaxial compression test at room temperature of 25 °C and high temperatures of 100~1000 °C. The study comes to some conclusions: (1) With the increase of temperature, the longitudinal wave velocity gradually decreases, and the damage factor of temperature gradually increases. (2) For uniaxial compression tests at different temperatures, the high temperature action within 500 °C has a strengthening effect on the compression strength, and the high temperature effect has a weakening effect on the compression strength when temperatures exceed 500 °C; so 500 °C is the temperature threshold. (3) For triaxial compression tests at different temperatures, the rock strength is positively correlated with temperature and confining pressure when the temperature is lower than 800 °C and the confining pressure is lower than 15 MPa; the rock strength is negatively correlated with temperature and confining pressure when the temperature is over 800 °C and confining pressure is above 15 MPa, so 800 °C is the temperature threshold, and 15 MPa is the confining pressure threshold. (4) In the triaxial compression, the actual fracture angle of the sample after high temperature is basically the same as the theoretical calculation value, high temperature has little effect on the actual fracture angle of the sample, and the actual fracture angle is negatively correlated with the confining pressure.