Tightening up during sex...

So I’ve been having sex with my boyfriend for over a year now and up until recently I’ve been too tight. I noticed it starts happening every time it starts to feel really good. The problem is that it starts to hurt him after a while of me clenching on him. I’ve tried to relax my muscles more and I can do it but as soon as I start heading to a climax I can’t stop myself from tightening up. Anyone else have an issue like this?

If so what can I do to relax and still climax?