Rajih Badi told China's Xinhua News Agency the attack occurred near Basindawa's home.
"[An] unidentified gunman went out from a car and opened fire at the prime minister's convoy on a street close to the Political Security Agency in Sanaa," Badi said.
The prime minister's bodyguards returned fire but the would-be assassin fled, the adviser said.
Xinhua said an Interior Ministry spokesman said the ministry was investigating the attack. It did "not bear the hallmarks of al-Qaida ... but there is possibility that al-Qaida did it," the spokesman said.
Basindawa has been in office since November 2011 following the United Nations' brokered resignation of President Ali Abdullah Saleh after a period of unrest.
A six-month period of national dialogue for the country's political parties to draft a constitution and prepare for February parliamentary and presidential elections is set to conclude Sept. 18.