A shooting erupted at an electronic music festival in the Mexican resort of Playa del Carmen, leaving at least five people dead and sparking a stampede, the mayor said.