"Access denied" means MySQL refused the username, the password, or the place the connection came from.

1. Check the prefix (the most common cause by far)

Hosting panels add a prefix to both the database and the user. Your settings must use the full names:

  • DB_NAME = u123456789_webfaze, not webfaze
  • DB_USER = u123456789_admin, not admin

Copy both exactly from hPanel → Databases, or cPanel → MySQL Databases. Check DB_PASSWORD too, then restart.

2. cPanel: is the user added to the database?

In MySQL Databases, use Add User To Database, pick both, and tick ALL PRIVILEGES.

3. Hostinger: names right, still denied?

On Hostinger, the app runs in a container, so MySQL sees the connection coming from an internal address rather than localhost. Webfaze handles this by itself: when it's refused this way and a local MySQL socket exists, it retries through the socket and logs Database: connected via Unix socket.

If it still fails, run the database test:

  1. Change the startup file to dbtest.js and restart.
  2. Read the log. It tries each possible host and the socket and says which one works.
  3. A socket line saying SUCCESS: add WEBFAZE_DB_SOCKET with the path it printed, remove DB_HOST, and restart.
  4. "Access denied" with an IP after the @: in hPanel → Remote MySQL, allow that IP address. It can change when Hostinger moves your app, so if the error returns, run the test again.
  5. Every line says "Access denied": the username or password is wrong.
  6. Set the startup file back to app.js and restart.

Allowing Any Host in Remote MySQL also works, but it opens the database to more addresses than needed. Try the socket first.

Or skip MySQL entirely: delete every DB_* setting and Webfaze uses SQLite. That suits a new site best.