  Thermal conductivity $\kappa$ of MgO plays a fundamental role in
understanding the thermal evolution and mantle convection in the interior of
terrestrial planets. However, previous theoretical calculations deviate from
each other and the $\kappa$ of high-pressure B2 phase remains undetermined.
Here, by combining molecular dynamics and deep potential trained with
first-principles data, we systematically investigate the $\kappa$ of MgO from
ambient state to the core-mantle boundary (CMB) of super-Earth with
$5M_{\oplus}$. We point out the significance of 4-phonon scatterings and modify
the conventional thermal conductivity model of MgO by considering the
density-dependent proportion of 3-phonon and 4-phonon scatterings. The $\kappa$
profiles of MgO in Earth and super-Earth are further estimated. For
super-Earth, we predict a significant reduction of $\kappa$ at the B1-B2 phase
transition area near the CMB. This work provides new insights into thermal
transport under extreme conditions and an improved thermal model for
terrestrial planets.
