I installed Magento with composer install, nginx server. When I am trying to launch my Magento in browser I am getting Error.
An error has happened during application run. See exception log for details.
I opened exception log file in my Magento2 directory and i see that error.
[2019-06-14 18:29:16] report.CRITICAL: MySQL adapter: Missing required
configuration option ‘host’ {“exception”:”[object] (InvalidArgumentException(code: 0): MySQL adapter: Missing required
configuration option ‘host’ at
/var/www/html/magento2/vendor/magento/framework/Model/ResourceModel/Type/Db/Pdo/Mysql.php:105)”}
[]
I dont know how to fix it. Searched in google but google says nothing about that error. Maybe someone can help me.
2
Answers
Please check your app/etc/env.php and verify the entries specific to your database.
I could fix my instance following the solution mentioned here. https://github.com/magento/magento2/issues/2852
I had this error during
bin/magento setup:upgrade
after performing aphp bin/magento setup:config:set ...
command for redis caching. What happened was in app/etc/env.php, Magento created an entry ‘db’ => ‘connection’ => ‘indexer’ where there wasn’t one before. However it did not have any db info or credentials. It seems there’s not much documentation on this entry in env.php. What I did was set the default database connection values here and got it working.env.php
Now I can run
setup:upgrade
with no error.