Drink at least 2L of water. Eat yoghurt, prunes and dragonfruit (the yellow ones work the best). Or if you need a quick fix, your doctor can give you some laxative for the short term.
Constipation is common during pregnancy. Just eat more fruits, vegetable or prunes. And about your pain if you still continue pain, you should go to consult with doctor.
https://sg.theasianparent.com/severe-pain-from-constipation-during-pregnancy https://sg.theasianparent.com/week-by-week-pregnancy-guide-week-32
My gynae advised me to drink vitagen for my constipation. Maybe you can try .
Try yogurt mix with fruit and eat as breakfast, it work on me:)
Drink more water , take more fruits