How to prevent connector from corrosion?
The corrosion looks like a Copper Salt (Like Copper Chloride).
This type of corrosion will only happen in the presence of moisture and a DC current and generally on the negative terminal. (electrolysis)
To prevent it, you need to prevent the moisture getting to the connector.
This can be done using a plastic tube around the connector with cable ties and some desiccant.
You can clean up the damage with some emery paper and methylated spirits. Then give it a spray with a contact cleaner (or WD40) to help displace any remaining moisture.