The dependence of the critical temperature Tc on the pressure P in the magnesium diboride MgB2 has been studied in the two-band model. In each band consists of two pairing interaction, electron-phonon interaction and non-electron-phonon interaction. This research derived the exact equation of the critical temperature dependence on pressure for magnesium diboride superconductor. It was found that increasing electron-phonon coupling constant and non-electron-phonon coupling constant of 1st and 2nd band will increase the Tc. The critical temperature decreased as pressure increased and can be fitted well to the experimental Tc versus P in magnesium diboride.