I am going to play devil's advocate. If you were a friend, a family member, someone I knew and liked, I would tell you you need to get out of there. The anxiety might be high initially, but I think you'll feel relieved that you no longer have to struggle with this relationship ON TOP OF your own health and well being. I was in a relationship for several years with the same thing: I wanted to eventually talk marriage and he didn't, but I kept saying "oh, one of us will change our mind." We didn't. And now I wonder all the experiences I missed out on because of trying to make that relationship work.
As for fearing being alone, if you aren't with someone who can be a source of comfort and support, it's already like being alone. And, to be brutally honest, it's selfish to stay with someone only because of fear.
Now, on the other hand, have you explained the extent of your anxiety to him? If so, does he understand and want to help? Have you talked to a doctor about the pain during sex? There might be something you could do. Maybe talking more with your boyfriend about the problems you're having would help better make the decision.
Only you know your relationship well enough to make the call, just stay strong, whatever you decide.