@Elmy is close to the answer from when I was a child: pharmacies and herbalists carry clove oil in little vials. This is the oil pressed from whole cloves, and it contains a natural anesthetic, eugenol (if you put a drop of it inside your cheek, it will make the spot where it was applied numb for a half hour or so).
In the 1960s and previous, when cavities were more common than they are now (because dental care was less advanced), it was actually pretty common for homes with children or adults with a history of dental issues to keep a vial of this in the medicine cabinet.
What we did then (this was fifty-plus years ago) was to take a drop of the clove oil on the point of a toothpick and apply it directly to the cavity (if visible), or to the gum line of the aching tooth and between that one and those next to it. Just a drop or at most two at a time.
Applied this way, the clove oil has the best chance to get into the cavity itself, and will also work down into the gingiva, which is another source of pain in the case of an abcessed root. This will often reduce the pain quite promptly.
Of course, this is also a useful adjunct to over the counter pain relievers like ibuprofen -- those last much longer, but a swallowed tablet takes fifteen to thirty minutes to take effect, so take the pills first, then apply the clove oil (not the opposite order, because the water to take the pills will wash away the clove oil).