Painful sex

I've been having sex with my boyfriend for two years, and I was able to get really aroused and I adjusted to him immediately. But the past couple of months, it's really painful when he first enters and for the first five minutes. Why is that, can I fix it?