The utility model belongs to the technical field of automatic door opening and closing structures, and discloses an opening and closing mechanism of a rack type door and the door, the opening and closing mechanism of the rack type door comprises a gear box, a rack and a driving mechanism, the gear box comprises an inner access opening and an outer access opening, the gear box is hinged to one end, away from a door shaft, of a door plate, and the inner access opening is located above the door plate; a main gear is arranged in the gearbox, the rack enters and exits the gearbox through the inner entrance and the outer entrance and is meshed with the main gear in the gearbox, and the end, extending out of the inner entrance, of the rack is used for being hinged to a door frame or a wall. The driving mechanism drives the main gear to rotate positively and negatively. The rack serves as a supporting rod, the gear box is hinged to the end away from the door shaft, the rack can obtain the maximum force arm, and the power of the driving mechanism is greatly reduced; resistance can be reduced under special conditions such as power failure or incapability of starting a driving mechanism, and manual opening or closing is facilitated; and installation and maintenance are convenient.