Once when Krishna was a little boy he went to a sage’s house who gave him a little amrita (immortal nectar) from a sacred cow. Krishna went home and asked his mother Yasoda to give him some amrita. She thought, “Where am I going to find immortal nectar”. So she boiled some milk with honey in it and said, “This is amrita”. Krishna said, “Dear Mother, this isn’t immortal nectar”. His Mother said, “I know my child, immortal nectar only comes from the Danavas-Gods. Pray to Lord Shiva, he will give you amrita”.
Undeterred, Krishna went high up into the Himalayan Mountains, to a place on the banks of the River Ganges, to the hermitage of the Sage Upamanyu. Krishna knocked on the door. The sage not to be disturbed for light reasons said “What do you want”. Krishna said he wanted immortal nectar from Lord Shiva. The Sage now realizing Krishna was the avatara said he would teach Krishna a prayer to Lord Shiva. Upamanyu said “okay, I’ll teach you the Sahasrahnama of Lord Shiva, if he appears he will give you amrita.”
Thus the little boy Krishna went with his water jug and some bread crumbs to the banks of the Sacred River to do his ablutions, and pray to Lord Shiva. After a long time The Chief of the Celestials, Lord Indra, appeared and said,” Here, I have come with amrita for you”. But, Krishna said to him,” Thank you Lord Indra, but I only want amrita from Lord Shiva”.
Indra went back to heaven. The boy Krishna continued for some more time to worship Lord Shiva. Finally, Shiva and his consort Parvati appeared and gave the boy amrita from a water pouch. Shiva and Parvati were pleased with the boy, and so gave him 8 boons.
Thus Krishna received immortal nectar and became invincible against all enemies other than when he was in confrontation with the Lord Shiva himself.