英文:
SSH Tunnel into Aurora DB via the CLI
问题
有没有一个简单的逐步示例来说明如何通过SSH连接到私有的Aurora MySQL数据库?
像这样的:
mysql -h dbDomain.pair.com -u dbUser -p dbName
英文:
Is there a simple step by step example on how to SSH into a private Aurora MySQL db?
something like:
mysql -h dbDomain.pair.com -u dbUser -p dbName
答案1
得分: 0
我认为您正在寻找如何配置RDS以实现远程访问,如果是这样的话,请查看这个链接:https://aws.amazon.com/premiumsupport/knowledge-center/aurora-private-public-endpoints/
对于我来说,我不会使我的数据库通过公共端点访问,而是将其设置为私有,只能从我的VPC局域网访问。
然后,我会使用一个EC2实例作为代理,通过SSH隧道从LAN IP访问数据库。
要做到这一点,您需要查看VPC文档,设置子网等。
AWS文档是一个很好的起点。
https://docs.amazonaws.cn/en_us/vpc/latest/userguide/what-is-amazon-vpc.html
更新:如果您已经将数据库设置为私有,请查看这个链接:
https://linuxize.com/post/mysql-ssh-tunnel/
英文:
I think you are looking for how to config RDS to be remote accessible, if that's the case, check this https://aws.amazon.com/premiumsupport/knowledge-center/aurora-private-public-endpoints/
For me I wouldn't make my db access via public endpoints, instead, I would setup as private and only can access from my VPC LAN.
Then I use a EC2 instance as proxy, and access the database via LAN ip from SSH tunnel.
To do that, you need check the VPC document, setup subnets etc.
AWS document is a good place to start.
https://docs.amazonaws.cn/en_us/vpc/latest/userguide/what-is-amazon-vpc.html
Update: if you already set the db to be private, take a look at this
https://linuxize.com/post/mysql-ssh-tunnel/
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论