[SOLVED] Database connection error on initial install

Hi, I am trying to install typo3 on MacOS silicon for local development in my zsh terminal. I installed orbstack and ddev successfully per the docs, then ran “ddev config --php-version 8.3” and had to manually change the “type” to typo3 when it was done. That went fine, then ran ddev start and it ran successfully:

Successfully started typo3

Your project can be reached at https://typo3.ddev.site

See 'ddev describe' for alternate URLs.

fpolli@FredBook typo3 % ddev composer create "typo3/cms-base-distribution:^13"

a whole lot of output


TYPO3 does not seem to have been set up yet, missing settings.php (/Users/fpolli/www/typo3/config/system/settings.php) 
Generating additional.php file for database connection. 

ddev composer create was successful. 

Then I ran the typo3 setup. I want to use postgres and I have a functioning installation on my MacBook that I have used with Laravel Herd. In the typo3 setup:

fpolli@FredBook typo3 % ddev typo3 setup
Which web server is used?
  [apache] Apache
  [iis   ] Microsoft IIS
  [other ] Other (use for anything else)
 > other
Database driver?
  [mysqli        ] [MySQLi] Manually configured MySQL TCP/IP connection
  [mysqliSocket  ] [MySQLi] Manually configured MySQL socket connection
  [pdoMysql      ] [PDO] Manually configured MySQL TCP/IP connection
  [pdoMysqlSocket] [PDO] Manually configured MySQL socket connection
  [postgres      ] Manually configured PostgreSQL connection
  [sqlite        ] Manually configured SQLite connection
 > postgres
Enter the database "username" [default: db] ? user
Enter the database "password" ? 
Enter the database "host" [default: db] ? 127.0.0.1
Enter the database "port" [default: 3306] ? 5432
☓ [Error]: An exception occurred in the driver: SQLSTATE[08006] [7] connection to server at "127.0.0.1", port 5432 failed: Connection refused
	Is the server running on that host and accepting TCP/IP connections?
Failed to run typo3 setup: exit status 1

I also tried accepting the default “host”.

I confirmed the connection details in TablePlus

Thank you.

If I understand you correctly, you want to use a Postgres database that runs outside of your DDEV setup, right?

I don’t think thats easy possible. But you can configure DDEV to use a Postgres database instead of MariaDB / MySQL. Please check the .ddev/config.yaml to see the available options.
After a ddev restart you should have a running Postgres database in your DDEV setup.

With ddev describe you can then see the database credentials. Normal user, password and host are db while port is the default one.

Hope that helps a little bit.

Very cool. Thank you for that explanation. I will start over and do as you suggest, and let you know how it goes.

I’m in!

Thanks for your help.

In production I am not going to want to use docker/ddev. I’m just going to want to directly work with my nginx-fpm and postgres servers. Is that going to be a nightmare?

Nope, that’s possible. You just need to have a different database configuration for production.