What is the meaning of Megrim?

A headache; a migraine.

A fancy, a whim, a caprice.

See megrims (depression; any of various diseases of animals).

A flatfish of the genus Lepidorhombus native to the northeastern Atlantic Ocean; specifically, a Cornish sole, sail-fluke, witch or whiff (Lepidorhombus whiffiagonis).

Source: wiktionary.org