简体   繁体   中英

Connecting to MySQL DB on RDS

I've recently encountered a phenomenon that absolutely baffled me. So far, I've been connecting without any problem to an Amazon RDS instance running MySQL. Right now, I'm trying to migrate to DB in the free tier - running on Microsoft Express Edition.

I've properly set up the security of the instance and can connect to it through SQL Explorer in Visual Studio 2012. However, I can't access it through Python (MySQLdb - same credentials, and same script that worked with first db):

2013, Lost connection to MYSQL server at 'reading initial communication packet', system error 104

Nor through MySQL-Front - connection failure.

I can't wrap my head around it - am I missing something obvious? Exactly the same thing happens on two machines - VS can connect, while nothing else can. Ideas?

Python connection attempt:

db = MySQLdb.connect(host = "yep-my-endpoint.us-west-2.rds.amazonaws.com",
                     user="user",passwd="mypasswd", port=1433, db="yep-db-name")

Is there maybe some setting that I have to set in connection for it to work? I failed to find anything related.

Have you checked your Amazon RDS Security Groups? Please note that in some cases, you'll need to add the IP address from which you're connecting. In that case, select a Security Group from the left menu, edit it and add the CIDR/IP.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM