Solar flares and magnetic storms belong to a set of phenomena known collectively as "space weather". Technological systems and the activities of modern civilization can be affected by changing space-weather conditions. However, it has never been demonstrated that there is a causal relationship between space weather and earthquakes. Indeed, over the course of the Sun's 11-year variable cycle, the occurrence of flares and magnetic storms waxes and wanes, but earthquakes occur without any such 11-year variability. Since earthquakes are driven by processes in the Earth's interior, they would occur even if solar flares and magnetic storms were to somehow cease occurring.
Learn more: Geomagnetism and Earthquake Predication