MySQL 8.0 SSL 설정하기

리눅스/MySQL|2021. 12. 15. 15:25
반응형

MySQL 8.0.26 버전에서 SSL 적용을 해보았습니다.

낮은 버전도 다르지 않다고 생각합니다.

 

[사전 준비]

- ssl 파일 위치 : /usr/local/mysql/ssl

- 체크 사항 : mysql 계정이 접근 가능한 경로 (/root/ssl 은 안됨), 파일 권한 확인 (mysql 계정 읽기)

 

 

1. 설정

# vi /etc/my.cnf

 

[mysqld] 섹션에 아래 내용 추가

ssl_cert = /usr/local/mysql/ssl/sysdocu.tistory.com.crt
ssl_key = /usr/local/mysql/ssl/sysdocu.tistory.com.key
ssl_ca = /usr/local/mysql/ssl/ca-bundle.crt

 

 

2. 확인

mysql> show variables like '%ssl%';
+-------------------------------------+--------------------------------------------+
| Variable_name                       | Value                                      |
+-------------------------------------+--------------------------------------------+
| admin_ssl_ca                        |                                            |
| admin_ssl_capath                    |                                            |
| admin_ssl_cert                      |                                            |
| admin_ssl_cipher                    |                                            |
| admin_ssl_crl                       |                                            |
| admin_ssl_crlpath                   |                                            |
| admin_ssl_key                       |                                            |
| clone_ssl_ca                        |                                            |
| clone_ssl_cert                      |                                            |
| clone_ssl_key                       |                                            |
| have_openssl                        | YES                                        |
| have_ssl                            | YES                                        |
| mysqlx_ssl_ca                       |                                            |
| mysqlx_ssl_capath                   |                                            |
| mysqlx_ssl_cert                     |                                            |
| mysqlx_ssl_cipher                   |                                            |
| mysqlx_ssl_crl                      |                                            |
| mysqlx_ssl_crlpath                  |                                            |
| mysqlx_ssl_key                      |                                            |
| performance_schema_show_processlist | OFF                                        |
| ssl_ca                              | /usr/local/mysql/ssl/ca-bundle.crt         |
| ssl_capath                          |                                            |
| ssl_cert                            | /usr/local/mysql/ssl/sysdocu.tistory.com.crt    |
| ssl_cipher                          |                                            |
| ssl_crl                             |                                            |
| ssl_crlpath                         |                                            |
| ssl_fips_mode                       | OFF                                        |
| ssl_key                             | /usr/local/mysql/ssl/sysdocu.tistory.com.key |
+-------------------------------------+--------------------------------------------+

 

 

반응형

댓글()