If you installed WordPress via the Cyber Panel or manually, but during the website creation process you selected the PHP version 8.1 instead of 7.4
Then install the PHP 8.1 first on your hosting.
Log into your droplet or hosting via terminal/command line (putty)
If you are on Ubuntu then
apt-get install lsphp81*
on Redhat flavours
yum install lsphp81*
This will solve your Database connectivity or installation issue.