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

Webiondev123's avatar

What host address you put in linode forge env file?

I am seeing once deployed localhost address. Doyou put local host address as DB host in forge env file or the domain address? if domain address what port?

0 likes
3 replies
ejdelmonico's avatar
Level 53

Well, if the DB is on the same server, try localhost. If that causes a connection error then use 127.0.0.1. The standard mysql port is 3306 but you can change that if you wish. Just remember that if you change a standard config then you will want to check that the port is open on the server. Overall, you are wanting to set the loopback address if the DB is on the same server. It will be one of those two.

ejdelmonico's avatar

I would use the the DB that has any auth tables in the DB_HOST value and you can create middleware to determine which DB should be connected for a query. The docs show one way of using multiple DB connections and accessing them via $users = DB::connection('foo')->select(...);.

Please or to participate in this conversation.