A well-developed sourdough should be able to generate a micro climate within his jar that supresses other growth like mold. This holds especially true for "old", well-established strains. We (1) use a sourdough strain that's been cultivated for at least 20 years. (After that, history becomes a bit murky...)
Young sourdough is the most susceptible to contamination and needs some time to develop a good souring/ leavening ratio. During the first weeks or even months, the baking properties of a sourdough might change quite a bit. So while a sourdough ist "working" after a few days, older lines are preferrable - the various yeasts will adapt to your conditions and develop a stable "society" (for lack of a better word).
As far as your mold problem is concerned, I'd just start over. You will have lost just a few days and your next batch will probably be fine. It's possible that in your moldy batch some "weaker" strains of yeasts grew that couldn't handle other micro-organisms. This happens sometimes. For old strains, I'd be tempted to try a "rescue mission" as described in the other post, but as the outcome is unclear, I wouldn't bother with a new batch. Just follow the instructions carefully, work with clean utensils and perhaps check your water -if it's heavily chlorinated you might be better off with bottled, at least in the beginning.
(1) "We" are a group of bakers that regularly bake and sell artisanal bread for charity.