Forums

mysql_exceptions.OperationalError: (2003

I encounter mysql_exceptions.OperationalError: (2003 when connect to aws rds mysql.

host = "something.rds.amazonaws.com"  (end point of aws)
pwd = "www"
dbname = "mydb"
user = "abc"

engine = mdb.connect(host='something.rds.amazonaws.com',user='abc',passwd='www',db='mydb',port=3306)

I am not sure what is going wrong.I have double check all the pw and username, it is correct.

Shall I actually enable VPC? Since I am actually using PA to process data. enter image description here

It looks like your RDS instance is in a VPC in the ap-southeast region. Is that right?

PythonAnywhere is in a VPC in the us-east region, and the RDS documentation says that '[i]f the DB instance and the EC2 instance are in different regions, you must use the public IP of the DB instance to access it.'

For that to work, it needs to be in a public subnet in your VPC -- is it?