Before installing a toilet flange in the bathroom, cut the toilet rough-in at a 45o angle. Take ABS flange or PVS plastic flange for the toilet rough-in.
Now, apply some solvent to the outer edge of the flange pipe. Install the flange in the toilet rough-in. Make sure to put the bolts on both sides of the flange at an equal distance.