  The stability of a sheared magnetic field is analyzed in two-dimensional
magnetohydrodynamics with resistive and viscous dissipation. Using a
multiple-scale analysis, it is shown that at large enough Reynolds numbers the
basic state describing a motionless fluid and a layered magnetic field, becomes
unstable with respect to large scale perturbations. The exact expressions for
eddy-viscosity and eddy-resistivity are derived in the nearby of the critical
point where the instability sets in. In this marginally unstable case the
nonlinear phase of perturbation growth obeys to a Cahn-Hilliard-like dynamics
characterized by coalescence of magnetic islands leading to a final new
equilibrium state. High resolution numerical simulations confirm quantitatively
the predictions of multiscale analysis.
