Hi everyone, hope someone could help. I am looking to use python to remotely connect to the DO’s MySQL database using the guide here:
Python code used:
import os import mysql.connector as database username = os.environ.get("username") password = os.environ.get("password") host_db = os.environ.get("host_db") db = os.environ.get("db") connection = database.connect( user=username, password=password, host=host_db, database=db)
however, I keep getting the error:
2003 (HY000): Can’t connect to MySQL server on ‘db-mysql-nyc1-16578-do-user-13436704-0.b.db.ondigitalocean.com:3306’ (10060)
One thing I am guessing (need help to verify) is that I enforced SSl (a ca certificate). Do I need to include the ca cert information in the connection?
Hope someone could help!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.