MySQL is a managed database service for deploying cloud-native applications.
Ensure that you have the following details before configuring MySQL as a source:
- Hostname or IP address
Configuring MySQL as a Source
Perform these steps to configure MySQL as a source:
On the Datasets page, click Add Source at the bottom-left corner of the Data panel.
Alternatively, select Databases in the Data panel. The page displays all database sources. Click the Add database button at the top-right corner of that page.
In the Add Data Source dialog, click MySQL.
The following section describes the source configuration settings in the New MySQL Source dialog.
Under General in the sidebar, complete the following steps:
For Name, enter a name.
For Host, enter the MySQL host name.
For Port, enter the MySQL port number. The default port is 3306.
(Optional) For Database, enter the MySQL database name.
For Authentication, choose one of the following options:
a. Select No Authentication to not provide credentials.
b. 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.
(Optional) Select Advanced Options in the sidebar and change any of the following settings:
|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 size||Number of records to fetch at once. Set to 0 (zero) to have Sonar automatically decide. The default record fetch size is 200.|
|Maximum Idle Connections||The 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.|
|Properties||Custom key value pairs for the connection relevant to the source. To add a connection property, click Add property and add the property name and value.|
Select Reflection Refresh in the sidebar and set time intervals for reflections to refresh or expire.
(Optional) Select Metadata in the sidebar and complete the following steps:
Select Remove dataset definitions if underlying data is unavailable. By default, Sonar 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.
Set the following Metadata Refresh parameters:
|Parameter|Description|Field|Setting Dataset Discovery|The refresh interval for fetching top-level source object names such as databases and tables.|Fetch every|You 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 Details|The metadata that Sonar 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 mode|You can choose to fetch only from queried datasets that are set by default. Sonar updates details for previously queried objects in a source. Fetching from all datasets is deprecated. Fetch every|You 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 after|You 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.
|Dataset Discovery||The refresh interval for fetching top-level source object names such as databases and tables.||Fetch every||You 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 Details||The metadata that Sonar 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 mode||You can choose to fetch only from queried datasets that are set by default. Sonar updates details for previously queried objects in a source. Fetching from all datasets is deprecated.|
|Fetch every||You 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 after||You 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.|
(Optional) Select Privileges in the sidebar and grant privileges to specific users or roles by completing the following steps:
- For Privileges, enter the user name 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 table.
- For the users or roles in the Users table, toggle the green checkmark for each privilege you want to grant to the MySQL source that is being created.
- Click Save.
Editing a MySQL Source
To edit a MySQL source:
On the Database page, click Databases. A list of databases is displayed.
Hover over the database and click the Settings icon that appears next to the source.
In the Source Settings dialog, you cannot edit the name. Editing other parameters is optional.
Removing a MySQL Source
To remove a MySQL source, perform these steps:
On the Datasets page, click Databases. A list of sources is displayed.
Hover over the source and click the More (...) icon that appears next to the source.
From the list of actions, click Remove Source. Confirm that you want to remove the source.caution
Removing a source causes all downstream views dependent on objects in this source to break.
Dremio offloads these operations to MySQL.
IS DISTINCT FROM
IS NOT DISTINCT FROM
IS NOT NULL