URGENT | MariaDB crashed after hitting "set as default services certificate" button

The issue is that older MariaDB versions are quite capricious about the private key.

If you look at MariaDB log on Ubuntu 20.04 at /var/log/mysql/error.log you’d see:

2023-04-28 18:25:16 0 [Note] InnoDB: Buffer pool(s) load completed at 230428 18:25:16
SSL error: Unable to get private key from '/etc/mysql/mysql-ssl.key'
2023-04-28 18:25:16 0 [ERROR] Failed to setup SSL
2023-04-28 18:25:16 0 [ERROR] SSL error: Unable to get private key
2023-04-28 18:25:16 0 [ERROR] Aborting

The fix for this problem is as simple as:

  1. Editing /etc/mysql/mysql-ssl.key and making a start and end blocks look like this:

    -----BEGIN RSA PRIVATE KEY-----
    -----END RSA PRIVATE KEY-----
    
  2. Run the following command:

    openssl rsa -in /etc/mysql/mysql-ssl.key -out /etc/mysql/mysql-ssl.key
    
  3. Restart MariaDB with the following command:

    systemctl restart mariadb
    

@Jamie, we need to consider older systems too, as this issue happens in Ubuntu 20.04 and doesn’t happen in Ubuntu 22.04…

1 Like