The unconfined compression test is widely used because of convenient specimen formation, simple experimental process, and low requirement for equipment. In view of the experimental characteristics, the axisymmetric mechanical model of a cylinder with horizontal friction was constructed and its elastic analytic solution was also deduced. The stress and the strain of the cylinder under unconfined compression with different boundary conditions were analyzed by using the analytical solution, and the failure characteristics of the cylinder under unconfined compression were studied and verified by laboratory testing. The results showed that the end restraint effect of the cylinder increased with the decrease of the height-to-diameter ratio and the increase of the Poisson ratio. When the end surface of the cylinder was constrained, the maximum tensile strain appeared in the middle of the cylindrical side; its value increased with the constraint effect, and greater loads were needed to make the same vertical displacement. The compressive strength derived from the current method would be too weak, and the compressive modulus of elasticity would be too great. If the end constraint was large, a small network crack first formed in the middle of the outer side of the cylinder, forming the double-tapered destruction. If the end face was weakly restrained, the cracks descended from the top to the bottom, and the specimens split.