Connection to test-proxy.proxy-#############.eu-west-1.rds.amazonaws.com 3306 port [tcp/mysql] succeeded
运行以下命令,以使用代理连接到 RDS 数据库实例:
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 连接的代理
完成以下步骤:
创建代理时,打开 Require Transport Layer Security(需要传输层安全)。您也可以修改现有代理。
**注意:**当您使用 TLS/SSL 协议时,代理会拒绝纯文本连接。
mysql -h test-proxy.proxy-#############.eu-west-1.rds.amazonaws.com -u admin --ssl-mode=VERIFY_IDENTITY --ssl-ca=AmazonRootCA1.pem -p
**注意:**代理使用通配符证书。如果您使用 MySQL 客户端连接 SSL/TLS 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.