Bidding to win his second title at the All England Club, Djokovic was playing his first match of the year on grass after losing in the semifinals at the French Open. He managed the switch from clay perfectly and controlled most of the match, saving the three break points he faced.
"It was a big pleasure again performing here on Centre Court in front of the packed crowd," Djokovic said. "For the first round, it was tricky. ... I think (Mayer's) game is really well suited for grass, so it took a lot of effort."
Djokovic won his only Wimbledon title two years ago.
The eighth-seeded del Potro did not play at the French Open because of respiratory problems.
Facing an opponent playing only his fourth tournament on grass, the big-hitting del Potro had 34 winners -- including 10 aces -- and maintained his record of always advancing to the second round at the All England Club in six appearances.
The 20-year-old Tomic won 7-6 (6), 7-6 (3), 3-6, 2-6, 6-3 after resisting Querrey's flurry of 36 aces.
The only top player Tuesday who had any difficulty advancing was French Open runner-up David Ferrer. He overcame a second-set slump and a scary late fall to beat Martin Alund of Argentina 6-1, 4-6, 7-5, 6-2.
Coming off his first Grand Slam final, the fourth-seeded Spaniard looked as if he could follow Rafael Nadal out of the tournament. Alund won the second set and pushed hard in the third. But Ferrer broke for a 6-5 lead and then went 5-1 up in the fourth. At 3-1, however, he fell and grimaced in pain after his left foot slid backward on the grass. Ferrer got back up, and went on to break Alund again. He served out the match with an ace, and afterward said his foot was "fine."
Tomic's father and coach, John Tomic, has been barred from attending Wimbledon even as a paying spectator, after also being banned from attending the French Open. John Tomic has been charged in Spain with assaulting his son's hitting partner before the Madrid Open.
Tomic said the victory was sweet, but he's not going to remain quiet while the ban is in place.
"I'm not going to say false things," Tomic said, suggesting that managers with the ATP often tell players how to respond to certain questions before post-match news conferences. "I'm going to say the truth of how I feel. It's disappointing."
James Blake of the U.S. ended a five-match Wimbledon losing streak by beating 93rd-ranked Thiemo de Bakker of the Netherlands 6-1, 6-3, 6-2 in the first round Tuesday.
The 33-year-old Blake, a former top-five player currently ranked 87th, reached the second round at the All England Club for the first time since 2008. He lost his opening matches at the grass-court Grand Slam tournament each of the past four years.
Blake's best Wimbledon showings were reaching the third round in 2006 and 2007.
Also Tuesday, No. 12 Kei Nishikori of Japan and No. 13 Tommy Haas of Germany won in straight sets, but No. 16 Philipp Kohlschreiber of Germany wasted a two-set lead against Ivan Dodig of Croatia and then had to retire in the fifth, citing the flu.
Tomic said he would ask Wimbledon officials if they would reconsider the ban before his second-round match against Blake.
"But Wimbledon's made their decision on behalf of the ATP," Tomic said. "So at the end of the day, it's the ATP I've got to be talking to. They're not really going to do anything."
ATP spokesman Simon Higson said the tour had no comment and referred to a statement given earlier in which John Tomic's suspension was explained: It took effect May 4 -- the date of the incident in Madrid -- for a 12-month period and will be reviewed at that point.
Information from The Associated Press was used in this report.