The present invention discloses a rotating shaft structure with automatic locking mechanism, characterized in which a shaft extending axially from an axial member passes through, in sequence, the core hole of the upright frame plane of the main frame, a friction disc, a disc-like connecting part connected with the frame plane, a cam member comprising a fastening part and a sliding part, at least an elastic body, and a connecting segment on the free end of the shaft connected with a end enclosure so as to form axial pressure to constrain the elements described above. The shaft and the main frame are provided with a linking portion and a connecting portion, respectively. The outer and inner edges of the adjoining planes between the fastening part and the sliding part are provided with at least a wedge block and at least a wedge slot alternately so as to connect the fastening part and the sliding part together. Consequently, when the axial member rotates, the inclined plane of the wedge slot of the sliding part moves upward along the inclined plane of the wedge block and thus axially presses the elastic body so as to prompt the contact plane of the sliding part to rotate along the wedge blocks of the fastening part. When the axial member rotates reversely, the wedge slots of the sliding part move to the wedge blocks of the fastening part and, under the extending action of the elastic body, the wedge slots are engaged into the wedge blocks so as to form an automatic locking of butting joint.