I have plenty of different rice, spices, beans, etc stored in larger mason jars for years. Some being used and restocked often, while others last for years. None of them has gone bad. I think as long as you keep it dry, you will be ok.

Furthermore on my 5 gallon buckets, I don't use Mylar... We use enough of the rice and beans to keep cycling them.