• Hello
    I have a problem with the connection to my MySQL with SSL from my WordPress. I can to use from my computer with the cert .pem a client MySQL and connect without any problem to my BD. How I can use the .cert in WordPress ?

    I’ve connect to my MySQL editing the following file and add the cert

    Client Mysql –> Usuario@nginx-php:/$ nano /etc/mysql/my.cnf
    [client]
    ssl-ca = /var/cert_mysql/SSL_server-ca.pem
    ssl-cert = /var/cert_mysql/SSL_client-cert.pem
    ssl-key = /var/cert_mysql/SSL_client-key.pem

    I’ve read on the Internet as other users did… But it does not work –> Usuario@nginx-php:/$ nano /var/www/websites/domain01/wp-config.php

    define(‘MYSQL_SSL_KEY’, ‘/var/cert_mysql/SSL_client-key.pem’);
    define(‘MYSQL_SSL_CERT’, ‘/var/cert_mysql/SSL_client-cert.pem’);
    define(‘MYSQL_SSL_CA’, ‘/var/cert_mysql/SSL_server-ca.pem’);
    define(‘MYSQL_SSL_CA_PATH’, ‘/var/cert_mysql’);
    define(‘MYSQL_CLIENT_FLAGS’, MYSQLI_CLIENT_SSL );

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter benivalero

    (@benivalero)

    Log:

    Warning: mysqli_real_connect(): (HY000/1045): Access denied for user ‘wordpress_valero-torres’@’xx.xx.xx.xx’ (using password: YES) in /var/www/websites/domain01/wp-includes/wp-db.php on line 1635
    Access denied for user ‘wordpress_valero-torres’@’xx.xx.xx.xx’ (using password: YES)

    I’ve change MySQL ip by xx.xx.xx.xx

    Moderator Yui

    (@fierevere)

    永子

    try this recipe:

    Configure WordPress to use SSL

    If all goes well so far, you can be confident that WordPress database connections will be unlikely to fail once configured. Now add your self signed SSL certificate to OpenSSL’s trusted store:

    # On the command line, run:

    sudo mv my-ca.crt /usr/local/share/ca-certificates/
    sudo update-ca-certificates

    The system’s trust store is where WordPress will look for SSL certificates. Important: The file name of the certificate must only end with a crt extension. my-ca.crt is fine, but my-ca.pem.crt and my-ca.pem are invalid!

    You must now instruct WordPress to use the system’s trust store to connect to MySQL using SSL. Set the appropriate settings in the wp-config.php file of your WordPress installation:

    // In wp-config.php, add:
    define('MYSQL_CLIENT_FLAGS', MYSQLI_CLIENT_SSL);

    At this point, WordPress will connect to the MySQL server through an SSL connection.

    This will help us to understand the issue.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘MySQL SSL not connect’ is closed to new replies.