Classical scholar. Mayor was born in Baddegama, Ceylon in 1825 where his father was a missionary. He attended the grammar school at Newcastle under Lyme and then Christ's Hospital. After an attack of scarlet fever he was educated at home where, with the help of his mother, he learnt Greek and Latin. In 1838, with assistance from his uncle, Richard Bickersteth, Mayor went to Shrewsbury School, and from there he proceeded to St John's College in 1844. He graduated BA in 1848, as third classic, and was elected to a Fellowship of the College the following year. From 1849 to 1853 Mayor was master of the lower sixth at Marlborough College. He did not enjoy his time at Marlborough, but it was during these years that he produced his most important publication, the scholarly commentary 'Thirteen Satires of Juvenal' (1853). In 1853 Mayor returned to St John's as assistant tutor and lecturer in classics. Though not a good lecturer, his lectures being too dense for the ordinary student, he was a member of a group of younger fellows who implemented important reforms in College organisation and teaching methods.
Mayor was an avid book collector, building up an immense library which included much biographical material, and was an accomplished linguist. He was also very interested in the history of his College and the University. In 1869 he published the 'History of the College of St John the Evangelist, Cambridge' by the eighteenth-century antiquary Thomas Baker, adding his own copious notes. His other publications were mainly on the classics, but also included some texts on history and historical figures. In 1864 he was elected unopposed as University Librarian, a post he held for three years, until he decided it impinged too much on his own studies. From 1872 until his death in 1910 he held the post of Professor of Latin, and he was also President of St John's from 1902.
Manuscript notebooks owned and compiled by Mayor, mostly classical and biographical.