It was discovered that the dates of the earthquakes of the summer 2012, being ordered in accordance with the corresponding Carrington rotations (CR) of the Sun nos. 2123–2127, form four discrete isolated groups, with a 30-day periodicity of the earthquakes in each group. On the Sun, the moments of the earthquakes correspond to four groups of the discrete Carrington longitudes (CL) of the four-sector structure of the large-scale open solar magnetic field (LOSMF). Close to each time of occurrence of the earthquake, the strong coronal mass ejections (CME) of Halo and Particle Halo types were identified. It was unexpectedly discovered that the occurrence times of the earthquakes and the onsets of CMEs are approximately synchronous, either keeping slightly ahead or lagging somewhat behind each other. This means that the earthquakes and CMEs are governed by a common external factor. The hypothesis that this could have been caused by the influence of Jupiter is supported by the discovered phenomenon of the eclipse of Jupiter by the Sun in May–June 2012, when the Sun occurred between Jupiter and the Earth and a significant decline in the magnitudes of the quakes was detected on the Earth.