Murray trounced the 92nd-ranked Slovenian 6-1, 6-1, 6-0 on Court 1 in a commanding performance as he seeks to become the first British player to retain the Wimbledon crown in 77 years.
Murray broke eight times, saved the only three break points against him and had only 13 unforced errors in a match that lasted 81 minutes.
"If you can finish matches as quickly as possible it definitely helps in the long run," Murray said.
The 23-year-old Rola, playing in his first Wimbledon, has been playing mainly on the lower-tier Challenger Circuit and has very little grass-court experience.
"I played well today," Murray said. "This is the first year he's played on grass. He just came out of college and he's broken into the top 100. It was tough for him today, he doesn't have much grass court experience but I think he'll keep improving."
The 90th-ranked Stakhovsky used the same serve-and-volley style that worked against Federer in 2013 to beat 12th-seeded Ernests Gulbis 6-4, 6-3, 7-6 (5) and get to the third round at the All England Club.
Last year, seven-time Wimbledon champion Federer's streak of 36 consecutive major quarterfinals ended with a loss in the second round to Stakhovsky, who then lost his next four Grand Slam matches in a row.
But back at Wimbledon, the Ukrainian found his touch again, winning points on 32 of 45 trips to the net.
"The surface is fast. It's no bounce. It's speedy. It's exactly what I need. So pretty much I have the chance of finishing that volley if I have it," Stakhovsky said. "On other surfaces, not so easy."
Gulbis, who reached the semifinals at the French Open this month, double-faulted nine times.
Stakhovsky is now 2-22 for his career in matches against top-10 players, with the only two victories at the All England Club, against Federer and Gulbis.
"That's why he beat Roger last year on grass," said Gulbis, who is ranked 10th. "The guy has a good game plan. He comes in; he chips the ball; he takes out the pace."
Information from the Associated Press was used in this report.