Can I ask why was it such a bad experience the first time?
I'm in a similar boat going back to university at 23, though I'll be living in student halls so socialising will be easier. I'd recommend joining a society (your boyfriend may also be allowed to join in some cases) seeing as usually if you like an activity like minded people often share the same interests.
Try to connect with a few people on your course, don't think of the age ranges too much, there will be people on the course both older and younger, but all of them are interested in the course and networking with them for studying or even just a coffee gives you a nice low pressure starting point. Try going to some of the Freshers events too, it might not be your style but chances are there will people just like you who aren't entirely sure about the experience.
All in all just relax, set aside time to socialise within and outwith your university and use it as an opportunity to learn and try new things, you won't always have time commuting but don't shut yourself out from everyone just because you aren't on campus or halls.