79550552

Date: 2025-04-02 12:01:52
Score: 1.5
Natty:
Report link

To fix this issue with SQLAlchemy, you need to use the correct driver syntax. For MySQL connections with public key retrieval, use mysql+pymysql:// instead of mysql:// and add the parameters to the query string:

engine = create_engine('mysql+pymysql://poopoo:peepee@localhost:32913/test?allowPublicKeyRetrieval=true&useSSL=false')

If you're still getting errors, you can also try passing these parameters via connect_args with the correct format:

engine = create_engine(
    'mysql+pymysql://poopoo:peepee@localhost:32913/test',
    connect_args={
        "ssl": {"ssl_mode": "DISABLED"},
        "allow_public_key_retrieval": True
    }
)

Make sure you have the pymysql driver installed: pip install pymysql.

Reasons:
  • Blacklisted phrase (2): poop
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Aryan Raj