It is the second such violent assault at a Chinese school in as many days.
Several websites reported up to four deaths in the early morning attack, but a city official told the AFP news agency it had so far received no such information.
"The gatekeeper, teachers, and students were attacked. The injured are receiving treatment in hospital," said the official, who declined to be named.
"We don't have any reports of deaths yet."
Al Jazeera's Divya Gopalan, reporting from Shanghai, said little details were known about the attacker, who was being questioned by police about his motive.
''He has been unemployed for many years and he was apparently involved in a pyramid scheme.
"The government has stepped up security in schools but schools remain very vulnerable. It's hard to install very high security in schools, where students and parents come in and out."
Photographs posted on Chinese websites showed dozens of people gathered outside the school, many of them apparently frantic parents.
Thursday's attack came a day after a teacher who had been on sick leave since 2006 for mental problems injured at least 15 students and a teacher in a knife attack at a school in southern China.
|Thursday's incident is the third such assault at a Chinese school this year [File: EPA]
In the attack in Guangdong province, Chen Kanbing, 33, burst into a primary school in the city of Leizhou and began stabbing students, Xinhua said.
He then jumped from a school building in an apparent suicide attempt before being arrested by police, the China Daily said.
None of the victims in Wednesday's attack had life-threatening wounds, Qin, the director of the command centre at the Leizhou Public Security Bureau, said.
Also on Wednesday, authorities in neighbouring Fujian province in the southeast executed Zheng Minsheng, a former doctor, for stabbing to death eight children outside their elementary school on March 23.
Police said Zheng, 41, used a dagger to stab children in the neck, chest, stomach and back in a fit of rage and depression after splitting from his girlfriend.
Five other children were seriously injured in that attack.
Zheng had admitted "intentionally killing" the children at a trial earlier this month, but had unsuccessfully appealed against the death penalty.