Docine error: Access denied for user in Symfony-4

0

I'm following the tutorial link , to start with Flex and they are Symfony.

The case is that when executing: ./bin/console doctrine:database:create I returned: '' '  [Doctrine \ DBAL \ Exception \ ConnectionException]
  An exception occured in driver: SQLSTATE [HY000] [1045] Access denied for user 'root' @ 'localhost' (using password: NO)

[Doctrine \ DBAL \ Driver \ PDOException]
  SQLSTATE [HY000] [1045] Access denied for user 'root' @ 'localhost' (using password: NO)

[PDOException]
  SQLSTATE [HY000] [1045] Access denied for user 'root' @ 'localhost' (using password: NO)
 '' '

The fact is that I do not know where I have to indicate the connection values to the bbdd.

Can someone tell me where the connection values of the bbdd are configured?

Thank you.

    
asked by Oskar Calvo 26.10.2017 в 13:18
source

1 answer

1

In Symfony4 and in development environment it is recommended to indicate the connection in the .env file:

###> doctrine/doctrine-bundle ###
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
# Configure your db driver and server_version in config/packages/doctrine.yaml
DATABASE_URL=mysql://db_user:[email protected]:3306/db_name

link

    
answered by 08.04.2018 / 08:57
source