Skip to content

How to connect a flask docker container to planetscale? #455

Discussion options

You must be logged in to vote

Hello,

In the Docker image you're using, you shouldn't need to download a CA bundle, you can point to the system CA bundle at this location: /etc/ssl/certs/ca-certificates.crt.

You also don't want to specify ssl_cert or ssl_key, only the system CA bundle should be necessary to verify the PlanetScale server.

Beyond that, you also want to be sure you're using mysql-connector-python and not the outdated mysql-connector package.

Here's a simplified version of our mysql-connector-python example that I was able to run in the same Docker image you're starting with:

From https://planetscale.com/blog/connect-to-a-mysql-database-in-python#connect-to-mysql-with-the-mysql-connector

from mysql.connector 

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
5 replies
@jgreet
Comment options

@abstractprototype
Comment options

@jgreet
Comment options

@abstractprototype
Comment options

@jgreet
Comment options

Answer selected by abstractprototype
Comment options

You must be logged in to vote
2 replies
@jgreet
Comment options

@TheCliffJumper
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants