|"I am looking for something that will keep a cable with a USB connector from being yanked out of its socket."|
Why do you want to be able to that ?
If whatever it is continues to be yanked on, if the plug cannot pull out, it's a lot more likely you will damage the plug for the device or the wiring in it's cable near the plug, and possibly the port it is plugged into.
If this is for a desktop, a disabled friend of mine had the problem of her mouse cable being vulnerable to getting yanked out by her un-intentionally snagging it with her wheelchair foot rest tray, or a lot more often, by one of her caregivers stepping on or tripping on the mouse cable near the computer. Eventually both front USB ports were damaged. She was using a long USB extension cable with her mouse, and the plug end was damaged frequently.
I solved the problem by connecting an additional short type A USB extension cable (male to female) to a back USB port on the computer, and looping and typing that cable around a leg on her computer desk, such that the short extension cable could be yanked on without any risk of the back USB port on the computer being damaged.
Whenever she snagged the cable, or they stepped on or tripped on the cable after that, the mouse cable would pull out of the extension cable easily. Even after that happening hundreds of times, at worst just the extension cable needed to be replaced. The better the quality of the USB extension, the longer it lasted ("dollar" store extension cables didn't last as long). The mouse cable itself stood up to that abuse for at least 3 years before I had to replace it.