2015-02-24 97 views
3

我無法連接到我的RDS實例,並不斷得到AWS RDS錯誤2003

ERROR 2003 (HY000): Can't connect to MySQL server on "my endpoint" 

我知道這個錯誤出現,因爲我的電腦沒有被授權訪問,因爲公衆開放的數據庫,但我無法讓我的電腦在安全組中授權。

我打開RDS安全組和它說的:

Using VPC? Visit the VPC page to create or manage VPC Security Groups and ingress rules to your DB Instances in VPC. Learn more about the differences between DB Security Groups and VPC Security Groups here. 

Your account does not support the EC2-Classic Platform in this region. DB Security Groups are only needed when the EC2-Classic Platform is supported. Instead, use VPC Security Groups to control access to your DB Instances. Go to the EC2 Console to view and manage your VPC Security Groups. For more information, see AWS Documentation on Supported Platforms and Using RDS in VPC. 

所以,我打開VPC安全組和添加了另一個安全組與

類型:MySQL(3306)協議:TCP(6)和Source作爲我的IP,另一個作爲我的EC2實例。

並將其添加到我的RDS安全組。

什麼都沒有發生。所以我查了一個教程,他們添加了一個CIDR/IP,我找不到它。

編輯:

我創建了公共無障礙的是其他的RDS實例。 我已成功地將Public Accessibility成功地設置爲Yes。 我將源代碼改爲了我的PC IP之外的東西,但它不起作用。它給出了同樣的錯誤。

回答

1

知道了! 我創建了一個新的安全組,並在RDS安全組中爲mysql添加了一個規則作爲新創建的組的安全組標識。

+0

你在創建新安全組的同時在tcp端口中添加了什麼? – dips 2015-07-01 19:08:32

+2

我爲端口3306和公共可訪問性的入站流量添加了新規則。您可以不通過非AWS系統連接到RDS實例。 – Mayank 2015-07-02 16:22:01

+0

請看看,如果你能弄清楚 - http://stackoverflow.com/questions/31211784/aws-hosting-error-with-ror。 – dips 2015-07-03 18:05:26

0

我在RDS安全組中添加了EC2實例的公共IP地址。 VPC使用相同的安全組。

1

對於我來說,MySQL的安全組設置爲一個特定的IP地址(創建一個新的MySQL RDS實例時,默認IP是你的PC /筆記本電腦目前的公共地址。

然而,在重新啓動後我的筆記本電腦,IP變化......這意味着我需要將當前筆記本電腦的公共地址添加到安全組 - >入站 - >類型:MYSQL /極光,協議:TCP,端口範圍:3306,來源:「您的公用IP地址」

您可以搜索在谷歌我的公開地址來獲得IP地址。 enter image description here

enter image description here