> ## Documentation Index
> Fetch the complete documentation index at: https://domoinc-openapi-sync-dataflows.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# MySQL Advanced Security Connector

## Intro

MySQL is a widely used open-source relational database management system. You can use Domo's MySQL Advanced Security Connector to pull data from your MySQL database and compile custom reports. You indicate the data you want by inputting an SQL query. For more information about the MySQL API, visit their website. ([http://dev.mysql.com/doc/refman/5.0/en/c-api.html](http://dev.mysql.com/doc/refman/5.0/en/c-api.html) )

The MySQL Advanced Security Connector is a "Database" connector, meaning it retrieves data from a database using a query. In the Data Center, you can access the connector page for this and other Database connectors by clicking **Database** in the toolbar at the top of the window.

You connect to your MySQL database in the Data Center. This topic discusses the fields and menus that are specific to the MySQL Advanced Security C onnector user interface. General information for adding DataSets, setting update schedules, and editing DataSet information is discussed in [Adding a DataSet Using a Data Connector](/s/article/360042926274 "Adding a DataSet Using a Data Connector").

<table class="mt-responsive-table" data-aura-rendered-by="33:209;a"><tbody><tr><td class="mt-noheading" colspan="1" rowspan="1"><p><b> Primary Use Cases </b></p></td><td class="mt-noheading" colspan="1" rowspan="1"><p> Pulling data mart and data warehouse SQL queries </p></td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"><p><b> Primary Metrics </b></p></td><td class="mt-noheading" colspan="1" rowspan="1"><p> N/A </p></td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"><p><b> Primary Company Roles </b></p></td><td class="mt-noheading" colspan="1" rowspan="1"><ul><li><p> CIO </p></li><li><p> CTO </p></li></ul></td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"><p><b> Average Implementation Time </b></p></td><td class="mt-noheading" colspan="1" rowspan="1"><p> 5-40+ hours </p></td></tr><tr><td class="mt-noheading" colspan="1" rowspan="1"><p><b> Ease of Use (on a 1-to-10 scale with 1 being easiest) </b></p></td><td class="mt-noheading" colspan="1" rowspan="1"><p> 7 </p></td></tr></tbody></table>

## Best Practices

* Limit the results set size is much as possible.
* Keep the number of columns to a minimum.

## Prerequisites

To connect to a MySQL database and create a DataSet, you must have the following:

* The username and password you use to log into your MySQL database
* The host name for the database
* The port number for the database
* The database name or schema name
* The SQL query you will use to pull data

You can also provide your SSL and CA Certificates, and the SSL key, though this is optional.

### Whitelisting

Before you can connect to a MySQL database, you must also whitelist a number of IP addresses on your database server on the port you want to connect to. For the full list of IP addresses, see [Whitelisting IP Addresses for Connectors](/s/article/360043630093 "Whitelisting IP Addresses for Connectors").

## Connecting to Your MySQL Database

This section enumerates the options in the **Credentials** and **Details** panes in the MySQL Advanced Security Connector page. The components of the other panes in this page, **Scheduling** and **Name & Describe Your DataSet**, are universal across most connector types and are discussed in greater length in [Adding a DataSet Using a Data Connector](/s/article/360042926274 "Adding a DataSet Using a Data Connector").

<Tip>
  **Note:** When using the copy/paste function for your credentials, ensure there is no whitespace at the beginning or end of the string. By accidentally pasting whitespace, it will cause the connector to error when trying to connect.
</Tip>

### Credentials Pane

This pane contains fields for entering credentials to connect to your database. The following table describes what is needed for each field:

<table border="1" cellpadding="1" cellspacing="1" data-aura-rendered-by="33:209;a"><thead><tr><th colspan="1" rowspan="1"><p> Field </p></th><th colspan="1" rowspan="1"><p> Description </p></th></tr></thead><tbody><tr><td colspan="1" rowspan="1"><p> Host </p></td><td colspan="1" rowspan="1"><p> Enter the host name for the MySQL database. </p><p> For example: <code> db.company.com </code></p></td></tr><tr><td colspan="1" rowspan="1"><p> Database Name </p></td><td colspan="1" rowspan="1"><p> Enter the name of the MySQL database or schema. </p></td></tr><tr><td colspan="1" rowspan="1"><p> Username </p></td><td colspan="1" rowspan="1"><p> Enter your MySQL username. </p></td></tr><tr><td colspan="1" rowspan="1"><p> Password </p></td><td colspan="1" rowspan="1"><p> Enter your MySQL password. </p></td></tr><tr><td colspan="1" rowspan="1"><p> Port </p></td><td colspan="1" rowspan="1"><p> Enter the port number for the database. </p></td></tr><tr><td colspan="1" rowspan="1"><p> CA Certificate </p></td><td colspan="1" rowspan="1"><p> Enter the URL where the CA Certificate is located (optional). </p></td></tr><tr><td colspan="1" rowspan="1"><p> SSL Certificate </p></td><td colspan="1" rowspan="1"><p> Enter the URL where the SSL Certificate is located (optional). </p></td></tr><tr><td colspan="1" rowspan="1"><p> SSL Key </p></td><td colspan="1" rowspan="1"><p> Enter the SSL key (optional). </p></td></tr><tr><td colspan="1" rowspan="1"><p> JDBC Driver </p></td><td colspan="1" rowspan="1"><p> Select the JDBC driver to use (optional). By default, the connector uses 5.1.45 </p></td></tr></tbody></table>

Once you have entered valid MySQL credentials, you can use the same account any time you go to create a new MySQL Advanced Security DataSet. You can manage connector accounts in the **Accounts** tab in the Data Center . For more information about this tab, see [Managing User Accounts for Connectors](/s/article/360042926054 "Managing User Accounts for Connectors").

### Details Pane

In this pane you create an SQL query to pull data from your database, with or without a parameter.

<table cellpadding="1" cellspacing="1" data-aura-rendered-by="33:209;a"><thead><tr><th colspan="1" rowspan="1"><p> Menu </p></th><th colspan="1" rowspan="1"><p> Description </p></th></tr></thead><tbody><tr><td colspan="1" rowspan="1"><p> Query Type </p></td><td colspan="1" rowspan="1"><p> Select the desired MySQL query type—either with or without a parameter. </p></td></tr><tr><td colspan="1" rowspan="1"><p> Query </p></td><td colspan="1" rowspan="1"><p> Enter the SQL query to execute. The query will execute on the MySQL server and will fetch the data from it. </p><p> For example: </p><p><code> select \* from Employee </code></p><p> You can use the <b><b> Query Helper </b></b> to help you write a usable SQL query. To use the <b><b> Query Helper </b></b> , do the following: </p><ol><li><p> Select your database table and table columns in the appropriate menus. </p></li><li><p> Copy the SQL statement that appears in the <b><b> Query Helper </b></b> field. </p></li><li><p> Paste the copied SQL statement into the <b><b> Query </b></b> field. </p></li></ol></td></tr><tr><td colspan="1" rowspan="1"><p> Query Parameter </p></td><td colspan="1" rowspan="1"><p> Enter the query parameter value. This is the initial value for the query parameter. You can use this option to retrieve new data since the last run. </p><p> For example: If you entered the following query in the <b> Query </b> field, </p><p><code> select \* from test.lastValue where id \<= !\{lastvalue:id}! order by id desc </code></p><p> and then entered the following for the <b> Query Parameter, </b></p><p><code> !\{lastvalue:id}!=3 </code></p><p> then the first run would return 3 rows, and all subsequent runs would return 1 row, and the results would be ordered from largest to smallest. </p><p> Similarly, if you entered the following in the <b> Query </b> field, </p><p><code> select \* from test.lastValue where time > !\{lastrundate:time}! </code></p><p> and then entered the following for the <b> Query Parameter, </b></p><p><code> !\{lastrundate:time}!=01/01/1990 </code></p><p> then the first run would return 5 rows and all subsequent runs would return 0 rows. </p></td></tr><tr><td colspan="1" rowspan="1"><p> TinyInt Values Treated as Bit (Boolean) Values? </p></td><td colspan="1" rowspan="1"><p> Select <b> Yes </b> if you want TinyInt values to be treated as Boolean. </p></td></tr><tr><td colspan="1" rowspan="1"><p> Cast Boolean Values To... </p></td><td colspan="1" rowspan="1"><p> Select whether Boolean values will be cast to integers or strings. </p></td></tr><tr><td colspan="1" rowspan="1"><p> Database Tables </p></td><td colspan="1" rowspan="1"><p> Select the database table you want to import into Domo. </p></td></tr><tr><td colspan="1" rowspan="1"><p> Table Columns </p></td><td colspan="1" rowspan="1"><p> Select the table columns you want to import into Domo. </p></td></tr><tr><td colspan="1" rowspan="1"><p> Query Helper </p></td><td colspan="1" rowspan="1"><p> Copy and paste the SQL statement in this field into the <b><b> Query </b></b> field. For more information, see <b><b> Query </b></b> , above. </p></td></tr></tbody></table>

### Other Panes

For information about the remaining sections of the connector interface, including how to configure scheduling, retry, and update options, see [Adding a DataSet Using a Data Connector](/s/article/360042926274).

## Troubleshooting

* Verify the credentials using MySQL Workbench.
* Confirm the server supports encrypted connections.
* Confirm the Domo IPs are whitelisted.
* To speed up your runtime, make sure the tables you are joining don't have duplicate column names and that you call each column only once.

英語
