[Python] ❌ Error: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on...

Discussão em 'Python' iniciado por Stack, Julho 9, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to run a command line script on Windows which uses a Python function to return info from a Planetscale database. No matter what I do, I keep getting this error. How do I fix this? The error is not very descriptive and the linked page doesn't help either.

    ❌ Error: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on 'aws.connect.psdb.cloud'") (Background on this error at: https://sqlalche.me/e/20/e3q8)

    Note that the codebase was developed on macOS. I verified:

    1. I have a Planetscale account with a created database
    2. I'm using the correct credentials
    3. I'm using an SSL-based connection to Planetscale
    4. I can successfully connect (Test-NetConnection aws.connect.psdb.cloud -Port 3306)
    5. DNS resolution is working (Resolve-DnsName aws.connect.psdb.cloud)
    6. Network connectivity is fine (tnc aws.connect.psdb.cloud -Port 3306)
    7. The problem doesn't seem to be a corporate network blocking - I tried using a mobile hotspot and got the same error

    Continue reading...

Compartilhe esta Página