0

below is my code

`

from sqlalchemy import create_engine, text

db_connection_string = "mysql+pymysql://dvgrfhodw7c31y4ss9j5:dvgrfhodw7c31y4ss9j5@aws.connect.psdb.cloud/aws.connect.psdb.cloud?charset=utf8mb4"

engine = create_engine(
    db_connection_string,
    connect_args= {
        "ssl": {
            "ssl_ca": "/etc/ssl/cert.pem"
        }
    }
)

with engine.connect(db_connection_string) as conn:
    result = conn.execute(text("select * from jobs"))
    print(result.all())

`

the error am getting is this sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (1045, "Access denied for user 'dvgrfhodw7c31y4ss9j5'") (Background on this error at: https://sqlalche.me/e/14/e3q8)

i want to connect to planet scale database but getting access denied

2 Answers2

0

Try removing db_connection_string from the connect() call. Usually its just engine.connect(). You already added the db_connection_string as an argument for the engine in the lines above. Hope this helps!

Chup91
  • 66
  • 7
-1

It seems like you typed wrong Username when connecting to DataGrip

starball
  • 20,030
  • 7
  • 43
  • 238