참고:proxy_endpoint를 프록시 서버의 주소로 바꾸십시오. 프록시와 동일한 VPC에 있는 Amazon Elastic Compute Cloud(Amazon EC2) 머신에서만 앞의 명령을 실행합니다. 로컬 머신에서는 이 명령이 실행되지 않습니다.
출력 예시:
Connection to test-proxy.proxy-#############.eu-west-1.rds.amazonaws.com 3306 port [tcp/mysql] succeeded
다음 명령을 실행하여 프록시를 사용하여 RDS DB 인스턴스에 연결합니다.
mysql -h proxy_endpoint -u username -p
참고:proxy_endpoint를 프록시 서버의 주소로 바꾸십시오.
출력 예시:
Server version: 5.7.28-log
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
(선택 사항) TLS/SSL 연결에서 프록시 사용
다음 단계를 완료하십시오.
프록시를 생성할 때 전송 계층 보안 필요를 켭니다. 기존 프록시를 수정할 수도 있습니다. 참고: TLS/SSL 프로토콜을 사용하는 경우 프록시는 일반 텍스트 연결을 거부합니다.
Amazon Trust Services에서 Amazon Root CA 1 트러스트 스토어 .pem 파일을 다운로드합니다.
mysql -h test-proxy.proxy-#############.eu-west-1.rds.amazonaws.com -u admin --ssl-mode=REQUIRED --ssl-ca=AmazonRootCA1.pem -p
또는 TLS/SSL VERIFY_IDENTITY 모드에서 다음 명령을 실행하여 DB 인스턴스에 연결할 수 있습니다.
mysql -h test-proxy.proxy-#############.eu-west-1.rds.amazonaws.com -u admin --ssl-mode=VERIFY_IDENTITY --ssl-ca=AmazonRootCA1.pem -p
참고: 프록시는 와일드카드 인증서를 사용합니다. MySQL 클라이언트를 사용하여 TLS/SSL VERIFY_IDENTITY 모드로 연결하는 경우 MySQL 8.0 호환 mysql 명령을 사용해야 합니다.
출력 예제:
Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 12659040
Server version: 5.7.28-log
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.