17 weeks pregnant, constipated and feel like I have to go but only yellowish colored mucus comes out. Stomach pain mostly on left side what's wrong?

Pregnant constipatio. You sound very constipated, which is a very common finding in late preganancy, since there is so much baby weight pressing against the colon and rectum. The best and safest treatment is an otc product called "miralax", a white power, you fill a cap with powder, dump it into a glass of water or juice (no grittiness or bad taste), and drink it once a day as needed. It is safe for baby .
Prefer. That you not use laxatives. Your problem is apparently hard dry stool in your rectum giving you the urge to go and the discharge is just mucus slipping by the plug of stool. Try a couple of glycerine suppositories oer rectum a couple of hours apart to releive the blockage. If no help try a couple of fleet enemas (sodium bisphosphate). Once cleared be sure to drink 80-100oz of caffeine free fluid daily for the rest preg.