Murray helped Great Britain to a Davis Cup win over Japan last week but this was his first action on the tour since his Australian Open defeat to Novak Djokovic.
After receiving a first-round bye, the Scot showed signs of rust before coming through to book a date with Argentina's Federico Delbonis in the third round.
A double fault from Murray gave Granollers the first break of the match and a 3-1 lead. But not to be deterred the world no.2 broke straight back before holding his serve to level the set at 3-3.
Murray again broke the Spaniard and made it four games in a row when he held serve before Gronellers stopped the rot. The Scot then served out to secure the opening set in 43 minutes, despite hitting just one winner to his opponent's 14.
The second set went with serve to a tie-break where a perfect return of serve winner brought Murray three match points. He only needed one as a cross-court forehand winner secured him a straight-sets victory in an hour and 40 minutes.
"He's got quite a different game," said Murray of Granollers on the ATP's official website. "He's a very smart player and often makes the right decisions. He made it tough for me.
"When it gets windy here it can be difficult to play really well, I think. It does make it challenging."