It's not even in the Bible directly as such, though a similar verse exists in Proverbs 13 verse 24. The verse that most Christians use as "proof text" for thrashing their children is found in Proverbs 22 verse 15: "Foolishness is bound in the heart of a child; but the rod of correction shall drive it far from him."
As you state here, both have been mistranslated from their original meaning.