How to make WordPress use old database?

The message “Error establishing a database connection” could mean anything. It means there is an error, but no information as to what the error is.

To see the actual error, you can enable WP_DEBUG mode: Debugging in WordPress – Documentation

You should then be able to see the actual error message, and compare those against the common errors in this article:

Normally, your account username and password are also your MySQL username and password, meaning you have one user/password for all databases.

Softaculous muddies this a bit by creating its own users and passwords. If you’re migrating websites, you probably can’t use those credentials as they only have access to the specific database they were created for, not all databases in the account (I think).

So you’ll want to remove all the existing database credentials and enter the username, password, hostname and database name shown in the client area. Please don’t go mix and match credentials, it’s going to end badly.