The solar wind is an extended ionized gas of very high electrical conductivity, and therefore drags some magnetic flux out of the Sun to fill the heliosphere with a weak interplanetary magnetic field,. Magnetic reconnection-the merging of oppositely directed magnetic fields-between the interplanetary field and the Earth's magnetic field allows energy from the solar wind to enter the near-Earth environment. The Sun's properties, such as its luminosity, are related to its magnetic field, although the connections are still not well understood,. Moreover, changes in the heliospheric magnetic field have been linked with changes in total cloud cover over the Earth, which may influence global climate. Here we show that measurements of the near-Earth interplanetary magnetic field reveal that the total magnetic flux leaving the Sun has risen by a factor of 1.4 since 1964: surrogate measurements of the interplanetary magnetic field indicate that the increase since 1901 has been by a factor of 2.3. This increase may be related to chaotic changes in the dynamo that generates the solar magnetic field. We do not yet know quantitatively how such changes will influence the global environment.