Roddick lined up a quarter-final clash with fifth-seeded Czech Tomas Berdych.
Roddick, who was bothered by a pinched nerved in his shoulder in his five-set loss to Marin Cilic in the quarter-finals of the Australian Open last month, has also had his practice time limited by a sore knee.
But he said his second round match here, in his first event since the Australian Open, showed progress.
"Tonight it was just coming off a bit firmer and I was able to move the ball around a bit more - that comes from getting a match in," Roddick said.
Roddick broke Mayer for a 5-3 lead in the first set, and as the American took control Mayer was clearly frustrated.
"This was a good match for me," Roddick said. "I felt like he had big swings and I thought that forced him to play a bit more aggressively on the first ball of a point which in turn creates a little bit of a more hit-or-miss deal for him, which I thought caught up with him tonight."
Ricardas Berankis, ranked 255th in the world, made a bit of ATP history when he became the first Lithuanian-born player to reach a tour-level quarter-final. He upset Germany's Bjorn Phau, ranked 126th in the world, 7-6 (7/5), 6-3.
Berankis will play second-seeded Spaniard Fernando Verdasco, a 7-5, 6-2 winner over Germany's Benjamin Becker.
Seventh-seeded American Sam Querrey beat compatriot Taylor Dent, 6-4, 6-4 to advance to a quarter-final clash with American Michael Russell, who beat Belgian Xavier Malisse 6-4, 7-5.
In the remaining quarter-final, Uzbekistan's Denis Istomin will face sixth-seded German Philipp Kohlshreiber.