Diabetes can cause headaches for two reasons. The first is that the increased urination can lead to dehydration and with that dehydration comes headaches. Dehydration causes the brain to physically shrink just like a sponge that doesn’t have enough fluid and when this happens, it will actually pull away from the inside of the skull. This is a painful experience.
Later on, a headache might occur as a result of nerve damage. Increased blood sugar can interfere with blood flow which causes damage to the nerves and thus leads to headaches.