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

Comments

Projects
None yet
6 participants
@pixelplant
Copy link

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

This comment has been minimized.

Copy link
Contributor

commented May 18, 2016

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

@pixelplant

This comment has been minimized.

Copy link
Author

commented May 18, 2016

@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

This comment has been minimized.

Copy link
Contributor

commented May 23, 2016

related #3529

@KrystynaKabannyk

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Contributor

commented Jul 6, 2016

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

@nicoflemming

This comment has been minimized.

Copy link

commented Jul 3, 2019

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

This comment has been minimized.

Copy link

commented Jul 3, 2019

@magento-cicd2 can you also fix that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.