The Magnetic Field is what keeps the solar wind from blowing away The atmosphere and water. Not Gravity.
I was talking about Mars, not the sun.