Williams, playing her first match since winning the U.S. Open, had just converted a break point for a 6-5 lead and was clearly hot and bothered when she asked for treatment beside the court. She withdrew moments later and was helped from the court by a trainer.
Cornet beat Williams at Dubai in February and had a third-round win at Wimbledon. The Frenchwoman is the first player since Justine Henin in 2007 to beat Williams three times in year, the WTA said, and has improved to 3-3 in career meetings with the most dominant woman in tennis.
"I felt dizzy and nauseous in the first set and unfortunately couldn't continue," Williams said in a brief statement in which she apologized to fans.
Muguruza, who beat Williams in the second round at the last French Open, dropped the first set in 35 minutes but rallied to win the first four games of the second set and the last four games of the third to advance.
It was a bad afternoon for seeds on other courts, too. No. 10 Jelena Jankovic was trailing 4-1 when she retired against American player Coco Vandeweghe due to a back problem, and she joined on the sidelines No. 11 Sara Errani of Italy, No. 13 Ekaterina Makarova, and No. 16 Andrea Petkovic of Germany.
In evening matches, however, No. 3 Petra Kvitova of the Czech Republic trounced Karin Knapp of Italy 6-3, 6-0, No. 6 Eugenie Bouchard of Canada overcame a break in the third set to beat Mona Barthel of Germany 4-6, 6-3, 6-4, No. 7 Angelique Kerber of Germany had a 4-6, 6-2, 6-4 win over Zarina Diyas of Kazakhstan , and No. 8 Caroline Wozniacki held off Carla Suarez Navarro of Spain 6-1, 3-6, 7-6 (4).
The new WTA tournament attracted almost all of the top 20 women, but most of them are already out of contention. Hometown star Li Na didn't even start, the two-time major winner calling it quits on her professional career on Friday citing knee injuries.