0

I want to install a Prestashop with DDEV, but I can't connect to database.

I tried 127.0.0.1:32775 and localhost:32775, with "db" as user/db/password But I get this error:

Database Server is not found. Please verify the login, password and server fields (DbPDO)

Database is up and running, connection via commandline is working:

mysql --host=127.0.0.1 --port=32775 --user=db --password=db --database=db

Project information:

  • PrestaShop 1.7.6.2 Installer (I first tried github/composer installation - error, then zip download with wizard - same error)
  • ddev version v1.11.2
  • DDEV project type: php
  • Host: MacOS 10.15.1

DDEV config.yaml - changes to default: router_http(s)_port

APIVersion: v1.11.2
name: prestatest
type: php
docroot: ""
php_version: "7.2"
webserver_type: nginx-fpm
router_http_port: "880"
router_https_port: "8443"
xdebug_enabled: false
additional_hostnames: []
additional_fqdns: []
mariadb_version: "10.2"
nfs_mount_enabled: false
provider: default
use_dns_when_possible: true
timezone: ""

1 Answers1

3

ddev describe will show you the db connection information.

Host: db User: db Password: db Database: db

Mostly people forget the hostname configuration.

rfay
  • 9,963
  • 1
  • 47
  • 89
  • I used them already, still the error, I updated the original post – Andrea Schmuttermair Dec 09 '19 at 21:07
  • Your original post still shows you using 127.0.0.1 as the host, you want to use 'db'. That's the name of the host from within the container. – rfay Dec 09 '19 at 21:22
  • Yay, it works! Connection from WITHIN the container, didn't expect that, but hey, it works! – Andrea Schmuttermair Dec 09 '19 at 21:29
  • Yes, everything about the functionality of ddev is stuff that happens inside the containers. So you're telling the webserver how to access the dbserver, and both are inside docker containers. – rfay Dec 09 '19 at 21:41