Mieszko II Lambert, also spelled as Miezko II, was the king of Poland (990 - 1034). He was the son of Boleslaw I Chrobry and Rixa von Lothringen. Their children were Casimir I of Poland, Rixa of Poland, and Gertrude of Poland.
Mieszko II was a very educated man for his time. He was able to read and write, and knew both Greek and Latin. He is known (unjustly) as Mieszko Gnusny which means Lazy, Stagnant or Slothful. He received that name because of his most unfortunate ending of rule; but when he begin, he acted as a skillful and talented ruler.
Before he became king in 1025, he probably ruled as his father's governor in Krakow, most likely since 1013, when he supposedly built many churches.
He waged war against Germany (starting in 1028), quite successfully: he was able to repel the German army, and later he even invaded Saxony. He allied with Hungary, resulting for a while in the Hungarian occupation of Vienna. This war probably was because of family connections of Mieszko in opposition against emperor Conrad II in Germany.
To understand what happened later we have to tell a little about Mieszko's family. He had an older brother, Bezprym (son of an unknown Hungarian wife of Boleslaw, who was expelled by him later), and a younger one, Otton. According to old Slavic custom a father should divide his heritage between sons; however kingdoms should not be divided. So Mieszko's brothers received nothing from their father's legacy. In addition, Bezprym was the oldest son so many probably felt that he should succeed his father as king. However Bezprym from the beginning was disliked by his father, as denoted by his name (Piasts usually used names like Boleslaw, Mieszko, later also Kazimierz, Wladyslaw, or Emperor's names: Otton, Conrad, Heinrich: but Bezprym was a commoner's name, which implies that Boleslaw did not desire Bezprym to follow himin succession). He was send to a monastery.
Both Mieszko's brothers escaped abroad: Otton to Germany, Bezprym to Kiev Rus. Soon after both the German emperor and the great duke of Kiev, Yaroslaw the Wise, allied and made simultaneous invasions.
Facing two enemies, Germany from the west and Russia from the east, Mieszko escaped to Czech where he was probably castrated. Bezprym started his rule by sending his crown and other king's insignia to Germany. Mieszko returned soon, but this time he was forced to pledge allegiance to the German Emperor, and Poland was divided between him, his brothers Otton and Bezprym, and some mysterious Thiedric (probably nephew or cousin). Otton was killed by one of his own men, and Mieszko was able to reunite Poland. What happened next is a great puzzle. Today modern historians are guessing that Mieszko was killed in a plot organised by aristocracy (1034). After his death, peasants revolted. Why and when, we don't know exactly.
Casimir I of Poland, son of Mieszko, was either expelled by that uprising, or the uprising was caused by expelling by aristocracy. The uprising is called pagan reaction, but modern historians are arguing that it was rather caused by economical issues (huge new taxes for the Church, militarisation of early Polish kingdom: almost all male population drafted to serve in the army etc) than religious. Priests, monks and knights were killed; cities, churches and monasteries were burned. Chaos was even greater when suddenly Czechs invaded from the south. The land became divided between local rulers, of whom one is known (Maslav, who ruled Masovia). Greater Poland was so devastated that it ceased to be the core of the Polish kingdom. New Polish kings moved their capital to Little Poland, to Krakow.