MySQL不再有效

i have a very big problem.

I wanted to install a board software for my website named ABXD-legacy.

but since it is old, it requires an older version of mysql and php.

so i installed an older version of php, and found a tutorial to install an old version of mysql, so first it needed to unistall the version i have so i did it, but what i forgot is that it also deleted ALL MY DATABASES! and then when i wanted to install the old version it didn't worked! and while trying to reinstall the latest version of mysql i get errors like:

dpkg: error processing package mysql-workbench-community (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mysql-common
 mysql-community-server
 libmysqlclient20:amd64
 mysql-server
 mysql-workbench-community
E: Sub-process /usr/bin/dpkg returned an error code (1)

and on phpmyadmin i get the error "The mbstring extension is missing. Please check your PHP configuration."

i found many solutions for this problem on internet but nothing worked! help me please it is very important!