Nottinghamshire Police began investigating after the attack on the Al-Quba Masjid mosque in Sherwood, in the early hours of 18 June.
Two men, aged 27 and 30, have been charged with racially aggravated public order offences.
They are due before Nottingham Magistrates' Court on 1 August.
The 27-year-old man has also been charged with criminal damage.
Two men have been charged with hate offences after meat, believed to be pork, was allegedly smeared on the front door of a mosque.