Its important for people to show restraint when talking to their children, something that very open or gregarious people might not remember. People might forget that children are just that: children, rather than confidants or friends in which they can confide. Still, allowing people to learn from your mistakes is such an important thing.
Personally, I believe that children can learn from their parents' mistakes. However, children can also use them as an excuse. For example, a child may think, "My mom drank at a party, so I can, too!" Because of this, parents should be careful of what types of lessons they try to teach by sharing their own mistakes. Sometimes, it can be better to share about them after a child makes a similar mistake, to teach a lesson and show how a wrong can be made right.
You might have to leave out some of the details because our children really do not want to know everything about us, but it is a good idea to at least allude to the fact that we have made mistakes that we are not happy about so that they know we are human and not just preaching at them.
One important thing to keep in mind is that as a parent, we are not supposed to be our children's best friend. Admitting mistakes to better understand someone is a concept for best friends or siblings, not necessarily parents. Parents should admit mistakes to their children eventually, but only when the kids are old enough to truly understand the concepts involved.
It is okay to tell children about your own mistakes in order to teach them. Personally, it was beneficial for me as a child to understand that my parents were not perfect. It taught me not to expect everything that I set out to do to succeed. When a child can hear about mistakes they can take the appropriate action to avoid them themselves.