Are your connectors plastic or metal?
If they are metal, you could use some J-B Weld. That's about as permanent an adhesive that is on the consumer market.
Circuit boards are fiberglass, which means they are glass and epoxy.
Plastic usually won't stick with epoxies very well.
Doesn't the socket have mounting holes? DB25 connectors usually have mounting holes at either end. You can use standoffs to attach the connector at either end. If it's a circuit board that you made, drill a couple of matching holes for mounting it. If it's not your design, drilling holes in it may cause big problems, particularly if there are hidden layers.
In that case, the safest way to secure it would be to use hot glue.
Thanks -- I'll try hot glue. I can't mount the connectors they way they were intended to be mounted because the pins do not line up with the pin holes on my perfboard, and so I've wired them upside down.
I bought some of the 'extra strong' glue and a glue gun. I'm using a ribbon cable connected to DB25s to connect to the connectors I'm gluing down, and it's internal use so no people tugging on it.... hopefully it will work out.