Invalid port error when trying to read from PlanetScale MySQL databse
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2022 04:51 AM
Using the code below I am attempting to connect to a PlanetScale MySQL database. I get the following error: java.sql.SQLException: error parsing url : Incorrect port value. However the port is the default 3306, and I have used the correct url based on the PlanetScale documentation, and other members of my team can connect to it with this url using other platforms. Is Databricks doing something else here that I can't see?
remote_table = (spark.read
.format("jdbc")\
.option("driver", driver)\
.option("url", url)\
.option("dbtable", table)\
.option("user", username)\
.option("password", passwd)\
.option("ssl", True) \
.option("sslmode", "require" ) \
.option("sslcert", "dbfs:/mnt/folder/admin/client-cert.pem")\
.option("sslkey", "dbfs:/mnt/folder/admin/client-key.pem" )\
.load()
)