Error while trying to connect to the database server: Database access denied

I am attempting to install Matomo on my VPS.

It gives me the error:
Error while trying to connect to the database server: Database access denied
At database installation screen

My mysql host is “stats.domain.com” (obviously the domain is something else)
I use DreamHost and that is how that is setup rather than “localhost” like most hosts use.

What can I do to overcome this error?

@HikerShawn did you manage to solve this? Haveing the exact same problem

I have the exact same issue at my hosting provider. Step 2 of the installation wizard (System check) fails with:

[02-Sep-2026 13:20:01 UTC] PHP Fatal error: Maximum execution time of 60 seconds exceeded in … libs\upgradephp\upgrade.php on line 260, which lead to Database access denied

They have a MariaDB at localhost on port 3306, pretty default. When I configure / hack the database connection details in the config.ini.php manually to an empty database, I get an error that some tables are missing. So the database connection is able to work. But of course, I need to have the tables created by the wizard.

@HikerShawn , @Japhy or anybody else, do you maybe have a solution?

Thank you.