Saturday, February 17, 2018

Laravel/Doctrine randomly tries to connect to production database - development

Laravel/Doctrine randomly tries to connect to production database

I’m randomly getting server errors because Laravel is trying to connect to the production database, despite the fact that I have a .env file set up and a majority of the time it connects to the correct database.

Here is the error I am receiving:

[2018-02-17 08:05:54] production.ERROR: SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using password: NO) (SQL: select * from information_schema.tables where table_schema = forge and table_name = settings) {"exception":"[object]
(IlluminateDatabaseQueryException(code: 1045): SQLSTATE[HY000]
[1045] Access denied for user 'forge'@'localhost' (using password: NO)
(SQL: select * from information_schema.tables where table_schema = forge and table_name = settings) at C:wamp64wwwprojectsinfusedxvendorlaravelframeworksrcIlluminateDatabaseConnection.php:664,
DoctrineDBALDriverPDOException(code: 1045): SQLSTATE[HY000]
[1045] Access denied for user 'forge'@'localhost' (using password: NO)
at
C:wamp64wwwprojectsinfusedxvendordoctrinedballibDoctrineDBALDriverPDOConnection.php:47,
PDOException(code: 1045): SQLSTATE[HY000] [1045] Access denied for
user 'forge'@'localhost' (using password: NO) at
C:wamp64wwwprojectsinfusedxvendordoctrinedballibDoctrineDBALDriverPDOConnection.php:43)

Why would doctrine be trying to connect to the wrong database? Is it being insantiated before dotenv sometimes?



from Laravel Questions and Answers https://laravelquestions.com/php/laravel-doctrine-randomly-tries-to-connect-to-production-database/
via Lzo Media

No comments:

Post a Comment