The 36-year-old rocker spent an hour and a half at the higher education establishment in Oxfordshire, England, where he also passed on little bits of advice he has picked up over the years, reported Contactmusic.
Students took to Twitter to express their excitement over the visit, with some saying it was the best part about studying at the top university.
Mayer also took to the social networking site afterwards to thank the university for having him as a guest speaker.