# Fehlermeldung Could not connect to database

**URL:** <https://forum.shopware.com/t/fehlermeldung-could-not-connect-to-database/98664>\
**Category:** Shopware 6 (German)\
**Created:** [22. Februar 2023 um 13:39 UTC](https://forum.shopware.com/t/fehlermeldung-could-not-connect-to-database/98664 "2023-02-22T13:39:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![maisfeld](https://avatars.discourse-cdn.com/v4/letter/m/67e7ee/32.png) [@maisfeld](https://forum.shopware.com/u/maisfeld)\
**Post date:** [22. Februar 2023 um 13:39 UTC](https://forum.shopware.com/t/fehlermeldung-could-not-connect-to-database/98664/1 "2023-02-22T13:39:35Z")

</div>

Hallo,  
wenn ich in der .env auf dev umschalte erhalte ich folgende Fehlermeldung:

**Stack Trace**  
RuntimeException:  
Could not connect to database. Message from SQL Server: An exception occurred in driver: SQLSTATE[HY000] [2002] php\_network\_getaddresses: getaddrinfo for \_placeholder.test failed: Name or service not known

at /home/clients/xxxxxxxxx/web/dstock/vendor/shopware/core/HttpKernel.php:86  
at Shopware\Core\HttpKernel-\>handle(object(Request))  
(/home/clients/xxxxxxxxxxxx/web/dstock/public/index.php:85)

 ![Fehlermeldung](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/3X/e/6/e61940775340073d5b7d6f8d235be9f18aff95bc.jpeg)

Kann mir jemand weiterhelfen?

---

<div class="post-metadata">

**Author:** ![Max\_Shop](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Max\_Shop](https://forum.shopware.com/u/Max_Shop)\
**Post date:** [23. Februar 2023 um 10:01 UTC](https://forum.shopware.com/t/fehlermeldung-could-not-connect-to-database/98664/2 "2023-02-23T10:01:36Z")

</div>

> [@maisfeld](#):
>
> \_placeholder.test

Scheint so, als sei ein falscher MySQL-Server eingetragen: \_placeholder.test

Suche mal in deiner .env nach diesem Ausdruck. Welche Shopware-Version nutzt du denn?

---

<div class="post-metadata">

**Author:** ![maisfeld](https://avatars.discourse-cdn.com/v4/letter/m/67e7ee/32.png) [@maisfeld](https://forum.shopware.com/u/maisfeld)\
**Post date:** [26. Februar 2023 um 10:55 UTC](https://forum.shopware.com/t/fehlermeldung-could-not-connect-to-database/98664/3 "2023-02-26T10:55:12Z")

</div>

Hallo,

ich benutze Shopware 6.4.18.1.

in der .env habe ich von \_placeholder.test nichts gefunden.

Hier die env mit abgeänderten angaben.

```auto
# This file is a "template" of which env vars need to be defined for your application
# Copy this file to .env file for development, create environment variables when deploying to production
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration

###> symfony/framework-bundle ###
APP_ENV=prod
APP_SECRET=def0000000000000000000000000000000000000000000000000000000000000000000001
APP_URL=https://d-stock.ch
#TRUSTED_PROXIES=127.0.0.1,127.0.0.2
#TRUSTED_HOSTS=localhost,example.com
###< symfony/framework-bundle ###

###> symfony/swiftmailer-bundle ###
# For Gmail as a transport, use: "gmail://username:password@localhost"
# For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode="
# Delivery is disabled by default via "null://localhost"
# MAILER_URL=null://localhost
MAILER_URL=smtp://mail.ixxxxxxxxk.ch:465?username=shop@dxxxxxx.ch=&password=xxxxxxxxxx

###< symfony/swiftmailer-bundle ###

DATABASE_URL=mysql://kpyd_admin:nwnfnnwnfn.myd.infomaniak.com:5678/xxxx_xxxxxxx

COMPOSER_HOME=/home/clients/12345678901234567890/web/xxxxxxxxxx/var/cache/composer

INSTANCE_ID=xxxxnxnxnxnxnxnxnxnxnxnxxn

BLUE_GREEN_DEPLOYMENT=0

SHOPWARE_HTTP_CACHE_ENABLED=1
SHOPWARE_HTTP_DEFAULT_TTL=7200
SHOPWARE_ES_HOSTS=""
SHOPWARE_ES_ENABLED="0"
SHOPWARE_ES_INDEXING_ENABLED="0"
SHOPWARE_ES_INDEX_PREFIX="sw"

SHOPWARE_CDN_STRATEGY_DEFAULT="id"

```

Hast du vielleicht eine Idee?

---

<div class="post-metadata">

**Author:** ![Max\_Shop](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Max\_Shop](https://forum.shopware.com/u/Max_Shop)\
**Post date:** [26. Februar 2023 um 14:45 UTC](https://forum.shopware.com/t/fehlermeldung-could-not-connect-to-database/98664/4 "2023-02-26T14:45:15Z")

</div>

> [@maisfeld](#):
>
> `kpyd_admin:nwnfnnwnfn.myd.infomaniak.com`

user:password@host

Hier fehlt ein @

---

<div class="post-metadata">

**Author:** ![maisfeld](https://avatars.discourse-cdn.com/v4/letter/m/67e7ee/32.png) [@maisfeld](https://forum.shopware.com/u/maisfeld)\
**Post date:** [26. Februar 2023 um 15:34 UTC](https://forum.shopware.com/t/fehlermeldung-could-not-connect-to-database/98664/5 "2023-02-26T15:34:10Z")

</div>

Im Original ist ein @ vorhanden. Ich habe es wohl beim überschreiben entfernt.

---

<div class="post-metadata">

**Author:** ![Max\_Shop](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Max\_Shop](https://forum.shopware.com/u/Max_Shop)\
**Post date:** [26. Februar 2023 um 18:32 UTC](https://forum.shopware.com/t/fehlermeldung-could-not-connect-to-database/98664/6 "2023-02-26T18:32:12Z")

</div>

Dann suche mal bei Google nach „php\_network\_getaddresses failed: Name or service not known“. Das scheint ein Problem mit PHP zu sein und weniger ein Shopware-Problem.
