Skip to main content

MySQL

MySQL is a managed database service for deploying cloud-native applications.

Connect to MySQL

  1. In the Dremio console, click Add Data on the Home page.
  2. In the Add Data dialog, select MySQL.
  3. Configure the connection using the sections below, then click Save.

General

Under General in the sidebar, complete the following steps:

  1. For Name, enter a name for the connection. The name cannot include the following special characters: /, :, [, or ].
  2. For Host, enter the MySQL host name.
  3. For Port, enter the MySQL port number. The default port is 3306.
  4. (Optional) For Database, enter the MySQL database name.
  5. For Authentication, choose one of the following options:
    • Select No Authentication to not provide credentials.
    • Select Master Credentials to provide the username and password of a master database user with permissions to read required objects:
      • For Username, enter your MySQL database username.
      • For Password, enter your MySQL database password.

Advanced Options

(Optional) Select Advanced Options in the sidebar and change any of the following settings:

Advanced OptionDescription
Net write timeout (in seconds)Seconds to wait for data from the server before aborting the connection. The default timeout is 60 seconds.
Record fetch sizeNumber of records to fetch at once. Set to 0 (zero) to have Dremio automatically decide. The default record fetch size is 200.
Maximum Idle ConnectionsThe total number of connections allowed to be idle at a given time. The default maximum idle connections is 8.
Connection idle time (s)The amount of time (in seconds) allowed for a connection to remain idle before the connection is terminated. The default connection idle time is 60 seconds.
Query timeout (s)The amount of time (in seconds) for the query to be executed before it is canceled.
PropertiesCustom key value pairs for the connection. To add a connection property, click Add property and add the property name and value.

Reflection Refresh

  • Never refresh: Select to prevent automatic Reflection refresh; otherwise, the default is to refresh automatically.
  • Refresh every: Define how often to refresh Reflections, specified in hours, days, or weeks. This option is ignored if Never refresh is selected.
  • Set refresh schedule: Specify the daily or weekly schedule.
  • Never expire: Select to prevent Reflections from expiring; otherwise, the default is to expire automatically after the time limit specified in Expire after.
  • Expire after: The time limit after which Reflections expire and are removed from Dremio, specified in hours, days, or weeks. This option is ignored if Never expire is selected.

Metadata

(Optional) Select Metadata in the sidebar and complete the following steps:

  1. Select Remove dataset definitions if underlying data is unavailable. By default, Dremio removes dataset definitions if underlying data is unavailable. This can be useful when files are temporarily deleted and added back in the same location with new sets of files.

  2. Set the following Metadata Refresh parameters:

ParameterDescriptionFieldSetting
Dataset DiscoveryThe refresh interval for fetching top-level object names such as databases and tables. Fetch everyYou can choose to set the frequency to fetch object names in minutes, hours, days, or weeks. The default frequency to fetch object names is 1 hour.
Dataset DetailsThe metadata that Dremio needs for query planning such as information required for fields, types, shards, statistics, and locality. These are the parameters to fetch the dataset information.Fetch modeYou can choose to fetch only from queried datasets, which is set by default. Dremio updates details for previously queried objects. Fetching from all datasets is deprecated.
Fetch everyYou can choose to set the frequency to fetch dataset details in minutes, hours, days, or weeks. The default frequency to fetch dataset details is 1 hour.
Expire afterYou can choose to set the expire time of dataset details in minutes, hours, days, or weeks. The default expiry time of dataset details is 3 hours.

Privileges

This connection inherits privileges from Project settings. To grant specific users or roles additional privileges in this connection:

  1. Enter the username or role name that you want to grant access to and click the Add to Privileges button. The added user or role is displayed in the USERS/ROLES table.
  2. For the users or roles in the USERS/ROLES table, toggle the checkmark for each privilege you want to grant on the Dremio source that is being created.
  3. Click Save after setting the configuration.

See Privileges for additional information about privileges.

Edit a MySQL Connection

  1. On the Open Catalog page, under Connections, right-click the connection and select Settings.
  2. Update the connection configuration as needed.
  3. Click Save.

Delete a MySQL Connection

  1. On the Open Catalog page, under Connections, right-click the connection and select Delete.
  2. Click Delete to confirm.

Predicate Pushdowns

Dremio offloads these operations to MySQL:

*, +, -, /, %
<, <=, <>, =, >, >=, !=
AND, NOT, NOT LIKE, OR, ||
ABS
ACOS
ADD_MONTHS
ASIN
ATAN
ATAN2
AVG
CAST
CEIL
CEILING
CHAR_LENGTH
CHARACTER_LENGTH
CONCAT
COS
COT
CURRENT_DATE
CURRENT_TIME
CURRENT_TIMESTAMP
DATE_ADD
DATE_SUB
DATE_TRUNC_DAY
DATE_TRUNC_DECADE
DATE_TRUNC_HOUR
DATE_TRUNC_MINUTE
DATE_TRUNC_MONTH
DATE_TRUNC_SECOND
DATE_TRUNC_WEEK
DATE_TRUNC_YEAR
DEGREES
E
EXP
EXTRACT_DAY
EXTRACT_DOW
EXTRACT_DOY
EXTRACT_HOUR
EXTRACT_MINUTE
EXTRACT_MONTH
EXTRACT_QUARTER
EXTRACT_SECOND
EXTRACT_WEEK
EXTRACT_YEAR
FLOOR
IS DISTINCT FROM
IS NOT DISTINCT FROM
IS NOT NULL
IS NULL
LAST_DAY
LCASE
LEFT
LENGTH
LIKE
LN
LOCATE
LOG
LOG10
LOWER
LPAD
LTRIM
MAX
MIN
MOD
PI
POSITION
POW
POWER
RADIANS
RAND
REPLACE
REVERSE
RIGHT
ROUND
RPAD
RTRIM
SIGN
SIN
SQRT
STDDEV
STDDEV_POP
STDDEV_SAMP
SUBSTR
SUBSTRING
SUM
TAN
TIMESTAMPADD_DAY
TIMESTAMPADD_HOUR
TIMESTAMPADD_MINUTE
TIMESTAMPADD_MONTH
TIMESTAMPADD_QUARTER
TIMESTAMPADD_SECOND
TIMESTAMPADD_YEAR
TIMESTAMPDIFF_DAY
TIMESTAMPDIFF_HOUR
TIMESTAMPDIFF_MINUTE
TIMESTAMPDIFF_MONTH
TIMESTAMPDIFF_QUARTER
TIMESTAMPDIFF_SECOND
TIMESTAMPDIFF_WEEK
TIMESTAMPDIFF_YEAR
TO_DATE
TRIM
TRUNC
TRUNCATE
UCASE
UPPER
VAR_POP
VAR_SAMP

Data Type Map

Dremio supports MySQL data types, as shown in the following table which provides the mappings from MySQL to Dremio data types. If there are additional MySQL types not listed in the table, then those types are not supported in Dremio.

MySQL Data TypeDremio Type
BITBOOLEAN
BIGINTBIGINT
BIGINT UNSIGNEDBIGINT
BINARYVARBINARY
BLOBVARBINARY
CHARVARCHAR
DATEDATE
DATETIMETIMESTAMP
DECIMAL UNSIGNEDDECIMAL
DOUBLEDOUBLE
DOUBLE PRECISIONDOUBLE
ENUMVARCHAR
FLOATFLOAT
INTINTEGER
INT UNSIGNEDBIGINT
INTEGERINTEGER
INTEGER UNSIGNEDBIGINT
LONG VARBINARYVARBINARY
LONG VARCHARVARCHAR
LONGBLOBVARBINARY
LONGTEXTVARCHAR
MEDIUMBLOBVARBINARY
MEDIUMINTINTEGER
MEDIUMINT UNSIGNEDINTEGER
MEDIUMTEXTVARCHAR
NUMERICNUMERIC
REALDOUBLE
SETVARCHAR
SMALLINTINTEGER
SMALLINT UNSIGNEDINTEGER
TEXTVARCHAR
TIMETIME
TIMESTAMPTIMESTAMP
TINYBLOBVARBINARY
TINYINTINTEGER
TINYINT UNSIGNEDINTEGER
TINYTEXTVARCHAR
VARBINARYVARBINARY
VARCHARVARCHAR
YEARINTEGER