At least two rockets landed within 300 metres (yards) of the governor's compound, where Ghani was meeting local officials, while a third struck further off, said Ahmad Khan Sirat, spokesman for Ghazni police.
There was no word on any casualties but light and heavy weapons fire could be heard, he said.
Ghazni, on the main highway between the capital Kabul and southern Afghanistan, still bears the scars of days of heavy combat last month when hundreds of Taliban fighters stormed the city and overran large parts of the centre.
The attackers were eventually driven off with heavy losses by Afghan forces backed by U.S. air strikes but the assault caused shock across Afghanistan, underlining the insurgents' ability to mount large scale attacks on major cities.
Ghani's visit to Ghazni, accompanied by his wife, was aimed at assessing the security situation in the city.
More about: Afghanistan