In EE 3/4/5, your database connection configuration lives in your system/user/config/config.php
file. The configuration should look like this:
$config['database'] = array (
'expressionengine' =>
array (
'database' => '',
'hostname' => '',
'username' => '',
'password' => ''
),
);
Fill in the array with your appropriate values.
If this information is there and correct, you need to diagnose your MySQL running instance and verify your credentials actually work. I would recommend testing at the command line like so (when SSHed into your server):
mysql -h {mysql_server_address} -u {user_name} -p
This should then prompt you with a password, which if you get correct, should log you into the MySQL CLI. If this doesn't work from your command line, your server most likely can't connect to the MySQL server and you need to start from there.