Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

itinerix's avatar

Forge: cannot connect to separate MariaDB server

My app is a fresh Laravel install. I use Forge to manage Vultr servers.

My app server needs to connect to my db server. They are both installed on the same data center, and with Forge I enabled networking so the app can access the db (with private IP address).

However my app keeps getting an "SQLSTATE[HY000] [2002] Connection refused" error.

My app's env file:

DB_CONNECTION=mysql
DB_HOST=10.25.96.6
DB_PORT=3306
DB_DATABASE=mydatabase
DB_USERNAME=forge
DB_PASSWORD=s654fds532654fd6s

The db credentials are correct, as I can connect to the db with Sequel Pro.

EDIT: I am also using Cloudflare, for DNS and SSL certificate.

What am I missing?

0 likes
0 replies

Please or to participate in this conversation.