The Spanish left-hander, who has reached the semi-finals at Indian Wells in his last six appearances here, broke Mayer twice in each set to wrap up a commanding win in one hour 15 minutes.
In dazzling afternoon sunshine, the match ended when a Mayer forehand sailed wide and Nadal removed his green headband in triumph as the near-capacity crowd erupted in applause.
“It’s nice to be back playing at the very good level,” the Spaniard, who will next face compatriot Marcel Granollers, told reporters at the Indian Wells Tennis Garden. “Winning is the most important thing.
“It’s not easy to be back after a while without competition, but I did really well. I started the match very focused, very aggressive. I’m very happy about almost everything.”
Nadal, who dominated Mayer with his crunching ground strokes from behind the baseline, had not competed since he lost an epic Australian Open final to Novak Djokovic in January.
The world number two enjoys a superb record at Indian Wells where he won the title in 2007 and 2009 and was beaten in last year’s final by Serb Djokovic.
“This is a tournament that I love,” said the 25-year-old from Mallorca. “I enjoy a lot playing this tournament. Always in my career I’ve had good success here. I have played very good matches.
Granollers had earlier booked his place in the third round with a 6-3 2-6 6-3 win against Germany’s Tommy Haas.
Three-times champion and world number three Roger Federer was scheduled to launch his title bid at the ATP Masters 1000 event against American Denis Kudla later on Sunday.
In other matches, fifth-seeded Spaniard David Ferrer swept aside Bulgarian Grigor Dimitrov 6-2 6-2 and Serb Janko Tipsarevic eased past Gilles Muller of Luxembourg 6-4 6-2.
Sixth seed Jo-Wilfried Tsonga advanced when fellow Frenchman Michael Llodra retired hurt because of a knee injury when trailing 4-1.
The big-serving Tsonga will next face Czech Radek Stepanek, who crushed Belgium’s Xavier Malisse 6-2 6-1.
Juan Martin Del Potro of Argentina beat Australian Marinko Matosevic and Denis Istomin of Uzbekistan battled past Argentina’s Juan Ignacio Chela 7-6 6-7 7-5. — Reuters