The influence of water on the mechanical properties of rock is vital for determining the rock stability when subjected to changes of water conditions. In this paper, a series of uniaxial compression tests were conducted to investigate effects of cyclic wetting and drying on the mechanical properties of sandstone and mudstone collected from Chongqing city, China. The results showed that both elastic modulus and uniaxial compressive strength of sandstone and mudstone were reduced by wetting and drying cycles, and that the degradation rate of the two mechanic parameters of mudstone was always larger than sandstone. The parameters, including water adsorption, degradation degree of elastic modulus, degradation degree of uniaxial compressive strength, increase with the increase of the wetting-drying cycles (N). The relationship between these three parameters and the value of N + 1 could be well fitted by logarithmic curves. The average degradation degree was also used to describe the degradation of per time wetting-drying cycles. It is found that the average degradation degree of elastic modulus and uniaxial compressive strength decrease with the increase of wetting-drying cycles. Moreover, the relationships between the mechanical properties and the porosity are presented, which can be fitted by linear curves. In the cyclic wetting-drying process, the elastic modulus and the uniaxial compressive strength decreased with the porosity increasing, and the degradation rates of sandstone mechanic parameters were higher than those of mudstone.