The bacteria gets into well water not municipal water. I had this problem with a well once myself. The bacteria grows on the well casing, it is like a gel or slime. It comes from ground water getting into the well either through a open cap or a crack in the well casing. You kill it with chlorine. I rented a water tank for the two weeks it took to have my well flushed out. It cost about $350 to rent the tank and have it filled.
More information about formatting options