A man started to attack people at a grocery store in Machang Village in Liuzhou City, setting off panic among public.
An investigation showed that the man is a tenant at a nearby house, state-run Xinhua news agency reported.
The suspect is in police custody and further investigation is underway, police said.
China has witnessed several knife attacks in the recent past.
On July 13, three knife-wielding "terrorists" from Xinjiang, the mainly Muslim region in the far west, were killed by the police for attacking officers, local authorities said.