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

Ori's avatar
Level 4

Unable to connect to DB

Hi guys,

Today I decidet to use fore deployment for my websites. I use custom VPS. I have created new users for DB and also new DB. I have also changed .env file to match db and user settings.

but after I manually deploy it gives me this error:

Already up-to-date.
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postInstall
> php artisan optimize
Generating optimized class loader

                                             
  [PDOException]                             
  SQLSTATE[HY000] [2002] Connection refused  

I would appreciate any suggestions.

0 likes
1 reply
Ori's avatar
Level 4

Ok i noticed this, it says that /root/.forge/provision-xxx.sh: line 15: mysql: command not foun

How can I install sql server on that machine ? When I try ssh to server using root as username it throws this error `No supported auth methods available. (server sent public key)

Please or to participate in this conversation.