The single anode magnetron injection gun which will be employed to 8mm gyrotron of the casing by the permanent magnet experiments is designed. Firstly, analytic equations based on adiabatic theory and angular momentum conservation are used to examine initial design parameters of the electrode shapes. Secondly, the method of the numerical calculation is discussed and selected. Thirdly, the Numerical calculation and optimization is carried out by use of an self-redact electron trajectory code, the space charge effects and the velocity spreads is discussed. Lastly, the optimal parameters with electrode shapes and electronic trajectory was obtained. The single anode magnetron injection gun was employed in the experiments of the gyrotron.