Non-equilibrium molecular dynamics (MD) simulations were performed to study the influence of external alternating electric field and impurity Mg2+ on CaCl2 aqueous solution. It is examined in terms of the activity of particles, the water residence time and hydrogen bonding analysis. The results show that alternating electric fields can enhance the hydration between Ca2+ and coordinated water molecules and enhance the hydrogen bonding between water, the Mg2+ has the opposite effects. Furthermore, an alternating electric field with different frequencies was applied; the results show that the electric field with different frequencies can enhance the hydration between Ca2+ and coordinated water molecules. Additionally, by studying the change of the intensities of the alternating electric field, there is no linear relationship between the electric field intensity and the values of these parameters. The simulations results provide useful guidance for understanding the influence of the presence of impurity Mg2+ ions on the scale inhibition when the electric anti-fouling technology is used practically during industrial water processes.