When I try to create a database with the command
$ php bin/console doctrine:database:create
I get those errors
2019-04-02T12:45:01+02:00 [error] Error thrown while running command "doctrine:d
atabase:create". Message: "An exception occurred in driver: SQLSTATE[HY000] [104
5] Access denied for user 'root'@'localhost' (using password: YES)"
In AbstractMySQLDriver.php line 93:
An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for u
ser 'root'@'localhost' (using password: YES)
In PDOConnection.php line 31:
SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using pas
sword: YES)
In PDOConnection.php line 27:
SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using pas
sword: YES)
I uninstalled xmapp, composer, symbony and installed them again.
Followed those steps to install orm doctrine found here https://symfony.com/doc/current/doctrine.html
composer require symfony/orm-pack
composer require --dev symfony/maker-bundle
Modified .env file
DATABASE_URL=mysql://root:[email protected]:3306/test
Then, executing
php bin/console doctrine:database:create
And then, the error comes.
The .env file was looking like this:
DATABASE_URL=mysql://root:[email protected]:3306/articles
I just removed the password, and the problem was solved:
DATABASE_URL=mysql://[email protected]:3306/articles
Now the database is created.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With