The chiral magnetic effect is a phenomenon that an electric current parallel to the magnetic fields is induced in the presence of the chiral asymmetry in the fermionic system. In this article we point out that the electric current induced by the dynamics of a pseudo scalar field that anomalously couples to electromagnetic fields can be interpreted as a similar effect in the scalar system. Noting that the velocity of the pseudo scalar field, which is the phase of a complex scalar, represents that the system carries a global U(1) number asymmetry, we see that the induced current is proportional to the asymmetry and parallel to the magnetic field, which is the same to the chiral magnetic effect. We discuss that in a mechanism like the Affleck-Dine mechanism an asymmetry carried by the Affleck-Dine field can induce the electric current and give rise to the instability in the (electro)magnetic field if it is unbroken by the expectation value of the Affleck-Dine field.Cosmological consequences of this mechanism, which is similar to the chiral plasma instability, is investigated.