An earthquake with a 6.2 magnitude struck off Mexico's Pacific coast on Saturday, the U.S. Geological Survey said.