Home > Back-end >  Shopware database connection not working from CLI
Shopware database connection not working from CLI

Time:08-31

I have a working Shopware installation running on my server and I am trying to execute some commands from the terminal through ssh. The Shop itself runs perfectly fine, so the database connection is correct. However, when I try to run CLI scripts like bin/console plugin:list I get An exception occurred in driver: SQLSTATE[HY000] [2002] No such file or directory. I feel like the CLI is trying to connect to the DB via socket and not via TCP. However, I am clueless where to look or change the behaviour. Any suggestions?

CodePudding user response:

Have you tried to set your database host to 127.0.0.1 instead of localhost? There is a forum post about the same issue:

https://forum.shopware.com/t/bin-console-an-exception-occurred-in-driver-sqlstate-hy000-2002-no-such-file-or-directory/67109

  • Related