The invention discloses a riveting machine for riveting a circuit board. The riveting machine structurally comprises a control console, a telescopic rod, a motor, a pressing needle, an ejector pin and a base, the control console is electrically connected with the motor, the telescopic rod is connected to the bottom of the control console, the pressing needle is arranged on the telescopic rod, and the pressing needle and the ejector pin are indirectly matched together; and the pressing needle comprises a pressing disc, a connecting block, a spring, a connecting rod and an opening and closing buckle, the connecting block is connected between the telescopic rod and the connecting rod, the connecting rod is connected with the spring, a pressing disc is connected to the bottom of the connecting rod, and the opening and closing buckle is installed on the pressing disc. A pressure collecting assembly and a stable splicing device are arranged in a boost mechanism, in the pressing process of the bottom of a rivet, a clamping piece and a warping hook are mutually screwed, so that the pressure collecting assembly reversely shifts on the two faces of the stable splicing device and abuts against a hook of the stable splicing device, the friction force between the stable splicing device 553 and a round cap of the ejector pin is increased, and the stable splicing device 553 is prevented from slipping on the round cap of the ejector pin.