I'm not sure about taking a painkiller, but I thought I'd tell you what I do:
Sex hurts me every time and I've been having sex with my boyfriend for 3 1/2 years! The only way I can make it less painful, and more enjoyable for me, is to stimulate my clit whilst we're having sex (literally just shove my hand between us!) That way, I'm getting pleasure that I wouldn't usually (intercourse doesn't 'do' anything for me) and it takes my mind off the pain/uncomfortableless.
I hope that helps! If you do try taking a painkiller, please let me know if it helps!