Bayern withstands Hannover surge
It may have taken the defending champions a while to get warmed up, but once Mandzukic made the breakthrough in the 51st minute, their victory was never in any doubt.
Ribery added a second after the hour mark before coach Pep Guardiola made changes to his side in view of their first Champions League game of the season against CSKA Moscow.
Thomas Muller could have given Bayern the lead in the seventh minute when he took Arjen Robben's pass in his stride and skipped past Hannover goalkeeper Ron-Robert Zieler, but he sent his shot from an angle into the side-netting.
Leon Andreasen almost put through his own goal in the 19th minute when he deflected Muller's pass but Zieler, scampering back, pushed the ball away just before it crossed the line.
Andreasen went close at the other end five minutes later with a flicked header at the near post which flew just inches wide of the unguarded far post from a corner.
Hannover had another chance before the break with Didier Ya Konan's shot taking a deflection off Edgar Prib and striking the inside of the post before bouncing agonisingly across the face of goal.
Bayern finally got their act together in the second half, going in front in the 51st minute with a fine display of one-touch football.
Ribery passed to Robben, who touched the ball on to Toni Kroos, who sent it back into the middle for Mandzukic to sweep in - not one of the Bayern players took more than a single touch as the Hannover defence was finally breached.
Bayern's second goal was similarly exquisite with Robben trying to provide the finish from an angle, only to be denied by Zieler, who could do nothing to deny Ribery on the follow-up.
Hannover's challenge was effectively over and Guardiola allowed himself the luxury of resting some of his players for the final 30 minutes with one eye already on the midweek clash with CSKA, as Bayern begin their Champions League defence from a healthy position in the Bundesliga.