Query federation for MySQL in Databricks SQL

Preview

This feature is Experimental and has no support for Unity Catalog. Experimental features are provided as-is and are not supported by Databricks through customer technical support channels.

Databricks SQL supports read-only query federation to MySQL on serverless and pro SQL warehouses.

Connecting to MySQL with Databricks SQL

You configure connections to MySQL at the table level. You can use secrets to store and access text credentials without displaying them in plaintext. See the following example:

DROP TABLE IF EXISTS mysql_table;
CREATE TABLE mysql_table
USING mysql
OPTIONS (
  dbtable '<table-name>',
  host '<database-host-url>',
  port '3306',
  database '<database-name>',
  user secret('mysql_creds', 'my_username'),
  password secret('mysql_creds', 'my_password')
);