Skip to content

Add support for custom Mysql port #52

Description

@autopaybyphone

Thanks for the great work!

As of today, setting up with a Mysql database hosted on a port different from 3306 doesn't seem to work.

Indeed, the port gets set into DB_PORT, which isn't used anywhere.

The port should probably be kept in DB_HOST, so that wp_db uses it when parsing DB_HOST.

This patch seems to fix it:

if (array_key_exists('port', $env)) {
        putenv(sprintf('DB_PORT=%s', $env['port']));
        // to add:
        putenv(sprintf('DB_HOST=%s:%s', $env['host'], $env['port']));
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions