In order to study the effect of thermal damage caused by heating on resistivity of rocks, uniaxial compressive experiment was conducted on sandstone samples after heating treatment at different temperatures (from 25°C to 900 °C), and the resistivity of samples was tested in the whole loading process. After then, mercury injection experiment test was carried on the failed samples. Consequently, the relationship between resistivity, stress, porosity and derivative thermo gravimetric of samples was obtained. The experimental results showed that: (1) The resistivity of rock increased gradually with increasing load while the discreteness of the resistivity value occurred from 300°C; (2) With the heating temperature increase, the strength of rock gradually decreases. Conversely, the initial resistivity, porosity and peak strain gradually increase; (3) There is a threshold temperature around 300°C of sandstone samples which the physical and mechanical properties will change rapidly when the temperature exceed it. This study would be valuable to the identification of precursor information for thermal disasters in rock engineering.