This seems to suggest that php package to connect to mysql is missing. can you try installing sudo apt install php7.3-mysql and then running the sudo -u www-data php occ upgrade once again?
It was your issue that led me to think in this direction and help me solve mine ![]()