late 14c., migrane, "severe headache, especially on one side of the head," from Old French migraine, migraigne (13c.), from the vulgar pronunciation of Late Latin hemicrania "pain in one side of the head, headache," from Greek hēmikrania, from hēmi- "half" + kranion "skull" (see cranium).
The corrupt form megrim was common from 15c. on and is the principle entry for the word in Century Dictionary (1895), but it seems to be now obsolete or archaic even in its secondary senses of "depression; low spirits" and "a whim or fancy." Related: Migrainous.