Skip to content

entrypoint MySQL connection try and SSL #530

@jfcoz

Description

@jfcoz

MySQL SSL connection

When using WORDPRESS_CONFIG_EXTRA ( #142 ) to force MySQL SSL connection (because the server require this) via :

define('MYSQL_CLIENT_FLAGS', MYSQLI_CLIENT_SSL);

The MySQL connection try in entrypoint will not use this setting and slow down the startup by 30 seconds :

$maxTries = 10;
do {
$mysql = new mysqli($host, $user, $pass, '', $port, $socket);
if ($mysql->connect_error) {
fwrite($stderr, "\n" . 'MySQL Connection Error: (' . $mysql->connect_errno . ') ' . $mysql->connect_error . "\n");
--$maxTries;
if ($maxTries <= 0) {
exit(1);
}
sleep(3);
}
} while ($mysql->connect_error);

During this time the container will loop on this kind of errors :

MySQL Connection Error: (9002) SSL connection is required. Please specify SSL options and retry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions