Data-driven magnetohydrodynamic modelling of a flux-emerging active region leading to solar eruption