The British world number two was making his first appearance on court since last month's triumph in the Wimbledon final.
Murray looked rusty at the start of the opening set, but he was able to move into a 4-1 lead before coming through 6-4.
Granollers showed plenty of variety to his game and had the chance to serve out the second at 5-4. However, Murray broke back to force the tie-break on his way to closing out the match 7-2.
Waiting for Murray in round three will be Latvian Ernests Gulbis.