The first quantum private comparison (QPC) protocol via cavity quantum electrodynamics (QED) is proposed in this paper by making full use of the evolution law of atom via cavity QED, where the third party (TP) is allowed to misbehave on his own but cannot conspire with either of the two users. The proposed protocol adopts two-atom product states rather than entangled states as the initial quantum resource, and only needs single-atom measurements for two users. Both the unitary operations and the quantum entanglement swapping operation are not necessary for the proposed protocol. The proposed protocol can compare the equality of one bit from each user in each round comparison with one two-atom product state. The proposed protocol can resist both the outside attack and the participant attack. Particularly, it can prevent TP from knowing two users' secrets. Furthermore, the qubit efficiency of the proposed protocol is as high as 50%.