A web application generally needs a database name, database username, password, and database host.
- Use the full database and username exactly as shown in cPanel, including account prefixes.
- For databases hosted on the same cPanel server, applications commonly use
localhost, but use the host value appropriate to the server's actual database configuration. - If cPanel displays a separate remote database host, use that value for the intended external connection.
An “access denied” error usually points to credentials or privileges, while “cannot connect” can also indicate an incorrect host/port or unavailable service.