Obviously people have been eating grains for several millennia.
Actually, humans have only consumed cereal grains for about the last 10,000 years or less, representing 0.4% of our evolutionary history. Dr. Loren Cordain provides more details:
______________________________________________________________
The so-called "Agricultural Revolution" (primarily the domestication of animals, cereal grains, and legumes) occurred first in the Near East about 10,000 years ago and spread to northern Europe by about 5,000 years ago [Cavalli-Sforza et al. 1993]. The industrial revolution occurred roughly 200 years ago, and the technological revolution which brought us packaged, processed foods is primarily a development that has occurred in the past 100 years and has seen enormous growth in the last 50 years.
To gauge how little geologic or evolutionary time humans have been exposed to foods wrought by the agricultural revolution, let's do a little paper experiment. Take a stack of computer paper (the kind in which each page is connected to one another) and count out 212 eleven-inch (28-cm) pages. Then unravel the stack of paper and lay it out end to end--it will form a continuous 194-foot (59-meter) strip. Now, let's assume that 1 inch (2.54 cm) equals 1,000 years in our 194-foot strip of computer paper; thus, the first part of the first page represents the emergence of our genus 2.33 MYA and the last part of the last page represents the present day.
Now, take a slow walk down all 194 feet of the computer paper, and carefully look at each of the individual eleven-inch sections. When you get to the very last eleven-inch section (the 212th section), this represents approximately the beginning of agriculture in the Mideast 10,000 years ago; therefore, during the preceding 211 sheets humanity's foods were derived from wild plants and animals. This little experiment will allow you to fully grasp how recent in the human evolutionary experience are cereal grains.
Humans may have indeed eaten these foods for "millennia," but millennia (even 10 millennia) in the overall timeframe of human existence represents 0.4%. Because the estimated amount of genetic change (0.005%) which has occurred in the human genome over this time period is negligible, the genetic makeup of modern man has remained essentially unchanged from that of pre-agricultural man [Eaton et al. 1985].
_____________________________________________________________
If Cordain is correct, and I have no reason to doubt his information, consuming grains (at least large quantities of grains) is probably not a great idea (if you are trying to maintain optimum health).