Spain's world No.1 only dropped serve once as he reeled off a 6-3, 6-4, 7-6 (7/4) victory over the 52nd-ranked Argentine in 2hr 38 min on Rod Laver Arena.
Nadal, a losing finalist to Roger Federer last year in Melbourne, will face Bosnia-Herzegovina's 28th seed Damir Dzumhur in the third round.
It was a powerful performance from the 16-time Grand Slam champion, who conceded only 10 unforced errors, stacked up against his 40 winners.
Mayer played well and stuck to his guns, breaking serve for the only time in the match as Nadal was serving out to win, forcing the third set into a tiebreaker.
"It was an important victory for me, he's a tough opponent," Nadal said. "Leonardo is a player with big potential, he hits the ball so strong and you could see in the last couple of games how tough was he.
"I had to hit some great shots in the tie-break, he's a very dangerous opponent. "I am happy to be in the third round after being out of competition for a while, a second victory in a row is very important to me."
The win took the 31-year-old Spaniard's Australian Open record to 53-11 as he chases his second Australian title after beating Federer in the 2009 final.
Nadal, who is gunning for a 17th major title, was hampered by a knee injury at the tail-end of the 2017 season.
It forced him to skip the lead-up Brisbane International this month, and he only had a one-match workout at the exhibition Kooyong Classic in Melbourne ahead of the Open.
Nadal needs to reach the quarter-finals to be certain of retaining his world number one ranking after the Australian Open, with Federer breathing down his neck....