Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Setup:upgrade does not work with custom mysql port #4548
There's a blocking issue when you use a custom mysql port and run php bin/magento setup:upgrade
The schema install/update part calls on the DbValidator's checkDatabaseConnection method which does not pass the custom mysql port defined in app/etc/env.php so the update schema will fail.
The call is done in this file, https://github.com/magento/magento2/blob/develop/setup/src/Magento/Setup/Validator/DbValidator.php
As you can see, there is no port passed to the call so using a custom one will not work.
Hardcoding the port directly in this call allowed us to proceed with the upgrade. The same issue is present in the Enterprise version of Magento (at least version 2.0.2 as I have not been able to upgrade yet).
@mazhalai Yes, it's related mostly to #2735, so we need a way to either allow the usage of the 'port' config for both the site and the updater and prevent it being specified in the 'host' config, or allow it only in the 'host' config (in the format 'host:port') and throw an error if the 'port' option is also specified.