A hydraulic actuator employing a limit adjustable mechanical lock, the hydraulic actuator comprising an assembly of a housing having a first hole to receive a piston, which is formed at one side thereof with a rack gear to be engaged with a pinion gear connectable to a valve shaft, such that the piston is movable by a predetermined distance, wherein both opposite portions of the piston are recessed by a predetermined depth, and ball insertion grooves are formed in inner circumferential surfaces of recess parts, characterised by the hydraulic actuator further comprising: side covers coupled to opposite sides of the housing and having holder insertion holes to be open toward a first hole of the housing, wherein opposite end faces about the housing are screwed with plugs to block the holder insertion holes from an outside, a first holder having one side of an outer circumferential surface, which is inserted into the holder insertion hole in the side cover positioned at a side of the plug through screwing with an inner circumferential surface of the side cover, and a second hole hollowed to be open toward the first hole, wherein hydraulic pressure is introduced or discharged through the second hole, a second holder having one end screwed with the second hole in the first holder while the second holder is fitted-coupled to the inner circumferential surface of the side cover, having a third hole open toward the first hole, and having an end face which is positioned at a side of the second hole and bored with an inner diameter smaller than a diameter of the second hole, a locking unit having a rod inserted into the second hole and the third hole of the first holder and the second holder, respectively, while passing through a fourth hole of the second holder such that the rod is axially movable by a predetermined distance, wherein the rod allows a ball to be inserted into a ball insertion hole of the piston or to deviate from the ball insertion hole by hydraulic pressure, which is applied to the first holder and equal to or greater than predetermined pressure, or spring elastic force, to lock or unlock the piston, and a fluid passage extending from the housing to each of the side covers provided at the opposite sides of the housing such that the hydraulic pressure is selectively applied to first holes and second holes formed in both sides of the side covers and the housing. side covers coupled to opposite sides of the housing and having holder insertion holes to be open toward a first hole of the housing, wherein opposite end faces about the housing are screwed with plugs to block the holder insertion holes from an outside, a first holder having one side of an outer circumferential surface, which is inserted into the holder insertion hole in the side cover positioned at a side of the plug through screwing with an inner circumferential surface of the side cover, and a second hole hollowed to be open toward the first hole, wherein hydraulic pressure is introduced or discharged through the second hole, a second holder having one end screwed with the second hole in the first holder while the second holder is fitted-coupled to the inner circumferential surface of the side cover, having a third hole open toward the first hole, and having an end face which is positioned at a side of the second hole and bored with an inner diameter smaller than a diameter of the second hole, a locking unit having a rod inserted into the second hole and the third hole of the first holder and the second holder, respectively, while passing through a fourth hole of the second holder such that the rod is axially movable by a predetermined distance, wherein the rod allows a ball to be inserted into a ball insertion hole of the piston or to deviate from the ball insertion hole by hydraulic pressure, which is applied to the first holder and equal to or greater than predetermined pressure, or spring elastic force, to lock or unlock the piston, and a fluid passage extending from the housing to each of the side covers provided at the opposite sides of the housing such that the hydraulic pressure is selectively applied to first holes and second holes formed in both sides of the side covers and the housing.