Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup:upgrade does not work with custom mysql port #4548

Closed
pixelplant opened this issue May 18, 2016 · 7 comments
Closed

Setup:upgrade does not work with custom mysql port #4548

pixelplant opened this issue May 18, 2016 · 7 comments
Labels
Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@pixelplant
Copy link

pixelplant commented May 18, 2016

Hello

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.
It only happens when Magento tries to call the "information_schema" database. The connection to the Magento database works fine.

The call is done in this file, https://github.com/magento/magento2/blob/develop/setup/src/Magento/Setup/Validator/DbValidator.php
in the method checkDatabaseConnection

As you can see, there is no port passed to the call so using a custom one will not work.

        // establish connection to information_schema view to retrieve information about user and table privileges
        $connection = $this->connectionFactory->create([
            ConfigOptionsListConstants::KEY_NAME => 'information_schema',
            ConfigOptionsListConstants::KEY_HOST => $dbHost,
            ConfigOptionsListConstants::KEY_USER => $dbUser,
            ConfigOptionsListConstants::KEY_PASSWORD => $dbPass,
            ConfigOptionsListConstants::KEY_ACTIVE => true,
        ]);

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).

Thanks,
Radu

@mazhalai
Copy link
Contributor

mazhalai commented May 18, 2016

@pixelplant could be related to #4275 and #2735, however created ticket MAGETWO-52981 to investigate and fix.

@mazhalai mazhalai added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development PS labels May 18, 2016
@pixelplant
Copy link
Author

@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.

@piotrekkaminski
Copy link
Contributor

related #3529

@KrystynaKabannyk
Copy link

KrystynaKabannyk commented Jun 23, 2016

Hello @pixelplant, this issue has been fixed in the 2.1.0 Release, that's why I'm closing it. If you any questions or additional information regarding the issue feel free to reopen it or create a new one.

@tkn98
Copy link
Contributor

tkn98 commented Jul 6, 2016

@KrystynaKabannyk: Can you share the references in the repository regarding this fix changes?

@nicoflemming
Copy link

Same issue with ssl_ca parameter. So when you are using mysql-ssl connection setup:upgrade wont work, because while connecting to information_schema the ssl_ca parameter is omitted.

@nicoflemming
Copy link

@magento-cicd2 can you also fix that?

magento-engcom-team pushed a commit that referenced this issue Jul 30, 2019
[TSG] MFTF for 2.3 (pr20) (2.3-develop)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests

6 participants