无法从AWS EC2连接到RDS

编程入门 行业动态 更新时间:2024-10-28 12:29:39
本文介绍了无法从AWS EC2连接到RDS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我是新来的AWS和我在遇到麻烦连接到我的RDS实例,从我的EC2实例。我认为无论是坐在同一个VPC内。我可以用SSH2从腻子连接到我的EC2实例,我可以使用Eclipse连接到我的RDS实例。不过,我看不到连接到从EC2的RDS。当我尝试下面的命令:

I'm new to AWS and I'm having trouble connecting to my RDS instance from my EC2 instance. I think both are sitting within the same VPC. I can use SSH2 from putty to connect to my EC2 instance and I can use eclipse to connect to my RDS instance. However, I can't see to connect to the RDS from the EC2. When I try the following command:

EC2命令提示符>的mysql -h端点-P 3306 -u用户-p密码

ec2 command prompt> mysql -h endpoint -P 3306 -u user -p password

我收到以下错误:

输入密码:

ERROR 1049(42000):未知数据库密码

ERROR 1049 (42000): Unknown database 'password'

任何想法我做错了吗?此外,它为什么问我要我的密码了吗?我已经指定,在我的连接字符串。

Any ideas what I'm doing wrong? Also, why is it asking me for my password again? I've already specified it in my connection string.

任何帮助将是AP preciated - !谢谢

Any help would be appreciated - thanks!

推荐答案

好了 - 我能弄清楚什么是错的。看来我应该使用下面的连接到RDS:

Okay - I was able to figure out what was wrong. It seems that I should be using the following to connect to the RDS:

的mysql -u用户名-p -h端点DATABASENAME

mysql -u username -p -h endpoint databaseName

这促使我在我的密码,然后我连接到我的数据库上面,我已经设置了RDS实例进入。显然,你必须指定要连接到数据库,端口号是可选的。我能都与它没有它连接。我读过关于AWS的文档从未实际上有数据库名,这是被扔我。希望这可以帮助别人。

This prompts me to enter in my password, which then connects me to my database above in the RDS instance that I have set up. Evidently, you have to specify the database that you want to connect to and the port number is optional. I was able to connect both with it and without it. The documentation on AWS that I've read has never actually had the database name, which is what was throwing me off. Hope this can help someone else.

更多推荐

无法从AWS EC2连接到RDS

本文发布于:2023-11-15 16:29:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1596095.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:连接到   AWS   RDS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!