cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Azure Databricks – Lakehouse Federation MySQL Connection Fails but Works in Notebook

asrivas
New Contributor II

I am trying to set up a Lakehouse Federation connection to an Azure MySQL database. When I connect from a Databricks notebook using Python - mysql.connector, same cluster, it works fine.

But when I set up the Lakehouse Federation connection and test it, I get the following error:

 
"Error testing connection
Your request failed with status FAILED: [BAD_REQUEST] [CANNOT_ESTABLISH_CONNECTION] Cannot establish connection to remote MYSQL database. Please check connection information and credentials e.g. host, port, user, password and database options. ** If you believe the information is correct, please check your workspace's network setup and ensure it does not have outbound restrictions to the host. Please also check that the host does not block inbound connections from the network where the workspace's Spark clusters are deployed. ** Detailed error message: Could not connect to address=(host=<hostname>)(port=3306)(type=master) : (conn=2412345) Connections using insecure transport are prohibited while --require_secure_transport=ON.. SQLSTATE: 08001"


3 REPLIES 3

WiliamRosa
Contributor

Hi @asrivas,
 Looks like the issue is because your MySQL server has --require_secure_transport=ON, so Lakehouse Federation will only connect if SSL/TLS is properly configured. I’d suggest checking if your connection settings (host, port, user, password, database, and especially SSL options) are aligned with the docs — see if your setup matches what’s described here: https://learn.microsoft.com/en-us/azure/databricks/query-federation/mysql
. Also make sure there aren’t any outbound restrictions from the workspace or inbound blocks on the MySQL side. If it still returns an error, please share more details so I can try to simulate it in my environment.

Wiliam Rosa
Data Engineer | Machine Learning Engineer
LinkedIn: linkedin.com/in/wiliamrosa

asrivas
New Contributor II

Thanks for the guidance @WiliamRosa
We do need --require_secure_transport=ON on the source side. 

Since the connection works fine from a Databricks notebook, I’m assuming there aren’t any outbound or inbound network restrictions or blocks.

Also I've verified (host, port, user, password) - no issues there. I don’t see any dedicated SSL options except that I tried appending flags in the hostname and checked the 'trust server certificate' option.
databricks.png
 

 

WiliamRosa
Contributor

Hi @asrivas , I’ve been trying to simulate this on my side and in my case I was able to complete the connection, but I believe in your case the issue comes from the MySQL setting --require_secure_transport=ON. In the notebook it works because the driver handles SSL params more flexibly, but with Lakehouse Federation you need to either check the Trust server certificate box or append ?SSL=true&trustServerCertificate=true in the host field. If it still doesn’t work, it may be that your instance requires a valid certificate instead of just trusting, so you’d need to configure the CA cert on MySQL or make sure Federation is able to recognize it.

Wiliam Rosa
Data Engineer | Machine Learning Engineer
LinkedIn: linkedin.com/in/wiliamrosa

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now