Donadoni sacked by Napoli
"It is a necessary decision to give a new impulse to our season," the Serie A club's president Aurelio De Laurentiis said in a statement.
Donadoni, dismissed as Italy coach after their poor displays at Euro 2008, returned to management with Napoli in March but has paid the price for four away games without a point this season.
Fans were frustrated by his tactics and there were reports of discontent among the players.
Colourful president De Laurentiis, a film producer, had also criticised Donadoni in the media in recent weeks and his departure looked inevitable.
De Laurentiis, who re-formed the Naples club after bankruptcy in 2004 and dragged them back up the divisions to the top flight, spent more money than most in the transfer window and 15th place after seven games was not deemed good enough.
He was annoyed with the quality of players brought in and some who were let go, first clashing with sporting director Pierpaolo Marino who left last week.
Donadoni was next in the firing line with De Laurentiis giving him Sunday's game at AS Roma to save himself. A 2-1 defeat against an injury-hit Roma sealed his fate.
The former Italy and AC Milan midfielder only had limited coaching experience before succeeding Marcello Lippi as boss of the world champions in 2006 and his career has nose-dived since.
Mazzarri led stylish Sampdoria to sixth place in 2008 in his first year in charge but last season they limped home 13th in Serie A and he was replaced by Luigi Del Neri who has taken them to the top of the standings.
Mazzarri was previously assistant coach at Napoli in 1998.
Media reports had linked former Inter Milan coach Roberto Mancini with the Napoli role, one of the most demanding in Italian football given the fervent support the club receives from the population of the country's third biggest city.
Scudettos with Diego Maradona in 1987 and 1990 were followed by years of woe but De Laurentiis's money has led fans to expect European qualification at least.