My external keyboard sometimes connects

The keyboard that came with my tablet connects occasionally. I get the chime when it connects but then it disconnects right away. Is there a way to replace the 5 pin connector or is the female connection on the tablet itself. Any help with this is greatly appreciated.

crwdns2934089:0crwdne2934089:0 crwdns2934093:0crwdne2934093:0

crwdns2934109:0crwdne2934109:0

crwdns2889612:0crwdne2889612:0 0
crwdns2934285:0crwdne2934285:0