An automatic drilling and milling machine for a chain connecting pin shaft is mounted on a rack table face, the automatic drilling and milling machine comprises a vibration disc, a feeding guide rail, an air cylinder, clamping jigs, a flat table milling mechanism, a central hole drilling mechanism, a small hole drilling mechanism, a chamfering mechanism, an octagonal eight-station rotating disc, a precise cam indexer, an electric motor and an automatic drilling and milling machine body support. The octagonal eight-station rotating disc is arranged on the front side of the automatic drilling and milling machine body support, the precise cam indexer is arranged behind the octagonal eight-station rotating disc, the electric motor is arranged on the rear side of the automatic drilling and milling machine body support, the electric motor is provided with a compressed air flow divider, the vibration disc is arranged on one side of the octagonal eight-station rotating disc, the eight clamping jigs are mounted on the octagonal eight-station rotating disc, the flat table milling mechanism, the central hole drilling mechanism and the small hole drilling mechanism are arranged on the upper side of the octagonal eight-station rotating disc, and the chamfering mechanism is mounted on the front side of the octagonal eight-station rotating disc. According to the technology, the full-automatic production process of part machining is achieved, and production efficiency and product quality are improved greatly.