Take two different situations to compare internet communities to real life communities:
1. School
There's that kid that always harasses others by calling them names and making fun of them. Teachers or parents of other children tell his parents and they got to deal with it.
2. Night club
Everyone of age and appearance can get in. If you make trouble you get thrown out. If you change your appearance you can get back in.
We all know how effectively parents can deal with their children when it comes to No 1, and I'm not talking about the bad kid, there's also bad victims parents. And we also do know how much the authorities can do in real life to change these things. So there's not much hope for the online community either. It's a thing parents need to take care of, and again, both parents not only the perpetrators but also the victims parents.
And for the night club reference. If someone starts to harass you in the night club you either ignore him, retaliate or leave the club. Why don't people get taught to do that online too? The answer is rather simple. When you are online, you are inside the emotional and physical comfort zone of your own home, inside your personal space. That's what leaves people vulnerable to attacks that they likely would not care about in the outside world.
Not being anonymous on the internet doesn't solve a thing as the same things that happen online already happen in real life with everyone being clueless how to deal with it anyway.