Skip to content

MySQL Data Source Connections

Here is a programmatic example of a connection to a MySQL database.

CREATE DATACONNECTION mysql_connection CXNPROPERTIES
(
  'connection_type'='JDBC',
  'jdbc_driver'='mysql',
  'host'='<A cloud url or host accessible from the application>',
  'port'='<Port to connect to the DB>',
  'user_key'='awssm://my-username',
  'password_key'='awssm://my-password',
  'jdbc.db.name'='<Default database to connect to>'
);

Enable Query Pushdown

To enable transparent query pushdown, add mysql to the list of enabled engines in the OKERA_CTE_REWRITE_ENABLED_ENGINES configuration setting. Multiple engines can be enabled (in addition to the ones enabled by default) by providing them as comma-separated values in this configuration setting.

For example:

OKERA_CTE_REWRITE_ENABLED_ENGINES: dremio:direct,redshift,mysql