Madasura, demon of Intoxication, was the creation of Sage Chyavana. Shukracharya, guru to the Asuras, imparted to him the Shakti mantra of ‘Hrim’. Madasura meditated upon this mantra for centuries, until Shakti appeared and granted him the boon of fulfilling all his desires. Madasura ran amok and subjugated the three worlds. All virtue and goodness disappeared. The gods were then advised by Sanatkumara, Lord of Humanity, to invoke Ekadanta.
Seeing Ekadanta’s blue-skinned, terrifying form, seated upon a mouse, Madasura surrendered to the Lord. Ekadanta spared him but commanded that he never appear in places where the Lord is worshipped with true devotion. Madasura however, was left free to enjoy the fruits of any activity imbued with demonic qualities.
Avatar in Sanskrit means “descent”; in Hindu mythology, a deity descends from heaven to earth for a specific purpose. Sacred texts like the Ganesha Purana and Mudgala Purana state that Ganesha assumed eight avatars, each manifesting in a different epoch and descriptive of a single attribute. All the avatars had one purpose – to slay a demon.
Source :Ganesh Mall