  We establish global well-posedness of strong solutions for the nonhomogeneous
magnetohydrodynamic equations with density-dependent viscosity and initial
density allowing vanish in two-dimensional (2D) bounded domains. Applying
delicate energy estimates and Desjardins' interpolation inequality, we derive
the global existence of a unique strong solution provided that
$\|\nabla\mu(\rho_0)\|_{L^q}$ is suitably small. Moreover, we also obtain
exponential decay rates of the solution. In particular, there is no need to
impose some compatibility condition on the initial data despite the presence of
vacuum. As a direct application, it is shown that the similar result also holds
for the nonhomogeneous Navier-Stokes equations with density-dependent
viscosity.
