bin/magento setup:config:set --backend-frontname="admin")[...]
Module 'Magento_Theme':
Running data recurring...
Module 'Magento_Cms':
Module 'Magento_Customer':
Module 'Magento_Indexer':
Running data recurring...MySQL adapter: Missing required configuration option 'host'
It seems that when you run that it re-saves the config it also adds the following lines to app/etc/env.php

Now, that all looks fine, and notice that "host" is still there, under normal circumstances I'd just say it was unrelated but if I REVERT that change setup:upgrade works without issue.
Hi @zack6849. Thank you for your report.
To help us process this issue please make sure that you provided the following information:
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
@magento-engcom-team give me $VERSION instance
where $VERSION is version tags (starting from 2.2.0+) or develop branches (for example: 2.3-develop).
For more details, please, review the Magento Contributor Assistant documentation.
@zack6849 do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?
Engcom instances have no command line access so I can't test it with that instance, marking as yes to move the issue forward.
Hi @engcom-backlog-nazar. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.[x] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.
[ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.3-develop branchDetails
- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!
[ ] 5. Verify that the issue is reproducible on 2.2-develop branch. Details
- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x
[ ] 6. Add label Issue: Confirmed once verification is complete.
[ ] 7. Make sure that automatic system confirms that report has been added to the backlog.
Hi @zack6849 i'm not able to reproduce following steps you described, i have clean 2.2.6 installed via composer, in my case after bin/magento setup:config:set --backend-frontname="admin") In app/etc/env.php i have field host.
@engcom-backlog-nazar maybe it's some quirk with our configuration files then, I suppose I'll close it then
I encountered the same issue in M2 2.2.6 (self-hosted). DB connection 'indexer' was created as below, resulting in the error as per original author
'indexer' => [
'active' => '1',
'persistent' => NULL
]
We have same/similar issue on (deployed) Magento 2.3.3. Running bin/magento setup:config:set --http-cache-hosts=1.2.3.4 adds the http_cache_hosts section to env.php but also the DB indexer part (without a host). Which seems to break Magento cron for us (with the error: MySQL adapter: Missing required configuration option 'host'). Removing the indexer part solves the problem.
Most helpful comment
I encountered the same issue in M2 2.2.6 (self-hosted). DB connection 'indexer' was created as below, resulting in the error as per original author
'indexer' => [ 'active' => '1', 'persistent' => NULL ]