Hi @amieiro !
Yes, I updated that line correctly.
To update about the last reply:
- I converted the .pem file to a .crt with OpenSSL and built another image of the WordPress container with that certificate. Still doesn’t work.
- I understand that the updated ca-certificates.crt store serves this line alone in the wp-config.php:
define('MYSQL_CLIENT_FLAGS', MYSQLI_CLIENT_SSL);
So I defined these lines in the config to try something else:
define('MYSQL_SSL_CA', '/usr/local/share/ca-certificates/DigiCertGlobalRootCA.crt');
define('MYSQL_SSL_CA_PATH', '/usr/local/share/ca-certificates');
define('MYSQL_CLIENT_FLAGS', MYSQLI_CLIENT_SSL);
But still got the error.
To try another thing, I changed this line in the /var/www/html/wp-includes/class-wpdb.php file:
$client_flags = defined( 'MYSQL_CLIENT_FLAGS' ) ? MYSQL_CLIENT_FLAGS : 0;
To:
$client_flags = defined( 'MYSQL_CLIENT_FLAGS' ) ? MYSQL_CLIENT_FLAGS : MYSQL_CLIENT_SSL;
I know that I shouldn’t edit core files, but I wanted to somehow force SSL and at least the error now is different:
Warning: Use of undefined constant MYSQL_CLIENT_SSL – assumed ‘MYSQL_CLIENT_SSL’ (this will throw an Error in a future version of PHP) in?/var/www/html/wp-includes/class-wpdb.php?on line?1987
Warning: mysqli_real_connect() expects parameter 8 to be int, string given in?/var/www/html/wp-includes/class-wpdb.php?on line?2019
Warning: mysqli_get_server_info(): invalid object or resource mysqli in?/var/www/html/wp-includes/class-wpdb.php?on line?4120
Warning: mysqli_get_server_info(): invalid object or resource mysqli in?/var/www/html/wp-includes/class-wpdb.php?on line?4120
Warning: mysqli_get_server_info(): invalid object or resource mysqli in?/var/www/html/wp-includes/class-wpdb.php?on line?4120
Warning: mysqli_get_server_info(): invalid object or resource mysqli in?/var/www/html/wp-includes/class-wpdb.php?on line?4120
Warning: mysqli_get_server_info(): invalid object or resource mysqli in?/var/www/html/wp-includes/class-wpdb.php?on line?4120
Warning: mysqli_get_server_info(): invalid object or resource mysqli in?/var/www/html/wp-includes/class-wpdb.php?on line?4120
Warning: mysqli_query(): invalid object or resource mysqli in?/var/www/html/wp-includes/class-wpdb.php?on line?971
Warning: mysqli_select_db(): invalid object or resource mysqli in?/var/www/html/wp-includes/class-wpdb.php?on line?1233
Warning: mysqli_error(): invalid object or resource mysqli in?/var/www/html/wp-includes/class-wpdb.php?on line?3902
Cannot select database
The database server might be connected (meaning your username and password are fine) but the database?wordpress
cannot be selected.
- Are you sure it exists?
- Does the user have?
userdb
permissions to use the database?wordpress
?
- On some systems your database name is prefixed with your username, so it would be something like?
username_wordpress
.?Could that be the problem?