The application provides a five-axis rotary table of a rotary hydraulic device with an anti-overflow structure, which comprises a rotating shaft, a shaft sleeve and a
workbench, wherein a
positive pressure medium pipeline is arranged outside a high-pressure gas or high-pressure hydraulic oil pipeline of a first ring and a last ring, an opposite force acting on a high-pressure gas or high-pressure hydraulic oil annular sealing ring of the first ring and the last ring is applied, the high-pressure gas or high-pressure hydraulic
oil can be discharged through the
positive pressure pipeline, the high-pressure gas or high-pressure hydraulic oil is prevented from overflowing, and the five-axis rotary table is protected from being damaged, in addition, when the overflowing high-pressure gas or high-pressure hydraulic
oil can be output through the
positive pressure pipeline, the
pressure sensor detects
abnormal pressure and alarms, so that the damage of the high-pressure gas or high-pressure hydraulic oil annular sealing ring can be found in time, and the automatic clamping and positioning of a workpiece can be continuously and effectively used intelligently.