Setting up encrypted connections using X509

If the connections between the client and MySQL server are not encrypted, anyone who has access to the network could inspect the data. If the client and server are in different data centers, it is recommended to use encrypted connections. By default, MySQL 8 uses an encrypted connection, but if the encrypted connection fails, it falls back to an unencrypted connection. You can test that by checking the status of the Ssl_cipher variable. If the connection is established by localhost, cipher won't be used:

mysql> SHOW STATUS LIKE 'Ssl_cipher';+---------------+--------------------+| Variable_name | Value              |+---------------+--------------------+| Ssl_cipher    | DHE-RSA-AES256-SHA |+---------------+--------------------+ ...

Get MySQL 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.