It’s not altogether certain where this strange-looking word comes from. The first spelling, which appears at the end of the sixteenth century, is mulliegrums. That may be a fanciful form of the older megrims for a headache, an English contortion of the French migraine. By the sixteenth century megrims could refer to somebody suffering from low spirits, the same sense as mulligrubs then had. Later, mulligrubs could be used humorously for an attack of colic or stomach-ache.
You will find it only in the most comprehensive of modern dictionaries, as it is now rarely encountered outside some British dialects. That’s a pity, as it deserves wider circulation. Here’s an example, dated 1898, from Brann The Iconoclast by William Cowper Brann:
It is easy enough to say that a pessimist is a person afflicted with an incurable case of mulligrubs — one whom nothing in all earth or Heaven or Hades pleases; one who usually deserves nothing, yet grumbles if he gets it.
The word seems to have survived longer in Australia, in which country the word has evolved into mully-grub, another name for a witchetty grub (possibly because immigrants considered this Aboriginal food to be only suitable for giving one a stomach-ache). It has extended still further to refer to a kind of badly-bowled ball in cricket, a mullygrubber, which doesn’t bounce but rather skids along the ground.