B
B
BonBon Slick2017-12-02 15:22:13
PostgreSQL
BonBon Slick, 2017-12-02 15:22:13

SQLSTATE[08006] fe_sendauth: no password supplied?

Not sure what exactly is throwing this error:

###> doctrine/doctrine-bundle ###
DATABASE_URL=postgresql://homestead:[email protected]:54320/test
###< doctrine/doctrine-bundle ###

DefaultController
public function index()
    {
        // you can fetch the EntityManager via $this->getDoctrine()
        // or you can add an argument to your action: index(EntityManagerInterface $em)
        $em = $this->getDoctrine()->getManager();

        $product = new Product();
        $product->setName('Keyboard');
        $product->setPrice(19.99);
        $product->setDescription('Ergonomic and stylish!');

        // tell Doctrine you want to (eventually) save the Product (no queries yet)
        $em->persist($product);

        // actually executes the queries (i.e. the INSERT query)
        $em->flush();

        return new Response('Saved new product with id '.$product->getId());
    }

An example from the docs https://symfony.com/doc/current/doctrine.html
The database has been created and the migrations have been rolled up, but the insert does not work. Tried specifying both in url and doctrine.yaml
doctrine:
    dbal:
      default_connection: postgres
      connections:
         #Postgresql
         postgres:
            driver:  'pdo_pgsql'
            host:    'localhost'
            port:     '5432'
            dbname:   'test'
            user:     'homestead'
            password: 'secret'
            charset: UTF8
              default_table_options:
                charset: UTF8
                collate: utf8_unicode_ci
#    dbal:
#        # configure these for your database server
#        driver: 'pdo_pgsql'
#        server_version: '5.7'
#        charset: UTF8
#        url: '%env(DATABASE_URL)%',

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