B
B
BonBon Slick2017-11-24 23:41:16
symfony
BonBon Slick, 2017-11-24 23:41:16

Connect Symfony 4 to Homestead, PostgreSQL?

https://medium.com/@fabpot/symfony-4-a-quick-demo-...
This is the part of the code that is responsible for generating, mapping to the database, as I understand it.

###> doctrine/doctrine-bundle ###
DATABASE_URL=mysql://[email protected]:3306/symfony?charset=utf8mb4
###< doctrine/doctrine-bundle ###

I'm trying to connect like this:
#DATABASE_URL=jdbc:postgresql://localhost:5432/test?charset=utf8mb4
DATABASE_URL=postgresql://homestead:[email protected]:5432/test

Gives the expected errors:
./bin/console doctrine:database:create
./bin/console doctrine:schema:update --force

....

 [Doctrine\DBAL\Driver\PDOException]
  SQLSTATE[08006] [7] could not connect to server: Connection refused (0x0000274D/10061)
        Is the server running on host "localhost" (127.0.0.1) and accepting
        TCP/IP connections on port 5432?
  could not connect to server: Connection refused (0x0000274D/10061)
        Is the server running on host "localhost" (::1) and accepting
        TCP/IP connections on port 5432?

There is a database, created manually when starting Homestead.
Please tell me how is it right?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question