A patting mechanism includes a support base for support a user, a driving device mounted to the support base and having a pushing unit, and a patting device having a rod pivotally connected with the support base, a patting member fixedly connected with the rod, and an elastic member connected between the support base and the rod. Thus, the rod is pushed to a preloaded position when the pushing unit is activated, and the rod is pulled by the elastic member to a patting position when the pushing unit is stopped working, such that the patting member is driven by the rod to pat on the users back muscle repeatedly to relieve muscle soreness or help the user spit out phlegm.