# tMysqlConnection

Opens a connection to the specified MySQL database for reuse in the subsequent subJob or subJobs.

## tMysqlConnection Standard properties

These properties are used to configure tMysqlConnection running in the Standard Job framework.

The Standard tMysqlConnection component belongs to the Databases and the ELT families.

The component in this framework is available in all Talend products.

Information noteNote: This component is a specific version of a dynamic database connector. The properties related to database settings vary depending on your database type selection. For more information about dynamic database connectors, see [DB Generic components](https://help.qlik.com/talend/r/en-US/8.0/components/db-generic/db-generic-component).

## Basic settings

| Properties | Description |
| --- | --- |
| Database | Select the desired database type from the list and click<br>Apply. |
| Property type | <ul> <li> <p>Either <span>Built-in</span> or                        <span>Repository</span>. </p> </li> <li> <p> <span>Built-in</span>: No property data stored                     centrally.</p> </li> <li> <p> <span>Repository</span>: Select the repository file                     in which the properties are stored. The fields that follow are completed                     automatically using the data retrieved.</p> </li> </ul> |
| DB version | Select the version of the database to be used.<br><br>When the database to be used is RDS Aurora, you need to select Mysql 5 (deprecated).<br><br>Information noteNote: MySQL 5 has been removed from Talend Studio 8.0 R2026-04. Use MySQL 8.0 or later. |
| Host | Enter the IP address of the database server. |
| Port | Enter the listening port number of the database server. |
| Database | Select or enter the name of the database to be used. |
| Additional JDBC parameters | Specify additional connection properties for the database connection you are<br>creating. |
| Username and Password | Enter the database user authentication data.<br><br>To enter the password, click the [...] button<br>next to the password field, enter the password in double quotes in the pop-up dialog box,<br>and click OK to save the settings. |
| Use or register a shared DB Connection | Select this checkbox to share<br>your database connection or fetch a database connection shared by a parent or<br>child Job, and in the Shared DB connection name field<br>displayed, enter the name for the shared database connection. This allows you<br>to share one single database connection (except the database schema setting)<br>among several database connection components from different Job levels that can<br>be either parent or child.<br><br>This option is<br>incompatible with the Use dynamic Job and Use an<br>independent process to run subJob options of the<br>tRunJob component. Using a shared connection together with a<br>tRunJob component with either of these two options enabled<br>will cause your Job to fail.<br><br>This checkbox is not available when the Specify a data source<br>alias checkbox is selected. |
| Specify a data source alias | Select this checkbox and specify the alias of a data source created on the *Talend Runtime* side to use the shared connection pool defined in the data source configuration. This<br>option works only when you deploy and run your Job in *Talend Runtime*. |

## Advanced settings

| Properties | Description |
| --- | --- |
| Auto Commit | Select this checkbox to commit any changes to the database automatically<br>upon the transaction.<br><br>With this checkbox selected, you cannot use the corresponding commit<br>component to commit changes to the database; likewise, when using the<br>corresponding commit component, this checkbox has to be cleared. By default, the<br>auto commit function is disabled and changes must be committed explicitly using<br>the corresponding commit component.<br><br>Note that the auto commit function commits each SQL statement as a<br>single transaction immediately after the statement is executed while the<br>commit component does not commit only until all of the statements are<br>executed. For this reason, if you need more room to manage your transactions<br>in a Job, it is recommended to use the commit component. |
| tStatCatcher Statistics | Select this check box to gather the Job processing metadata at a Job level<br>as well as at each component level. |

## Usage

| Usage guidance | Description |
| --- | --- |
| **Usage rule** | This component is more commonly used with other tMysql\* components,<br>especially with the tMysqlCommit and<br>tMysqlRollback components. |

**Related concepts**

* [Checking customer table against a given DQ rule to select customer records](https://help.qlik.com/talend/en-US/components/8.0/mysql/tmysqlconnection-tmysqlinvalidrows-tlogrow-tmysqlinvalidrows-tlogrow-checking-customer-table-against-given-dq-rule-to-select-customer-records-standard-component-enterprise-this)
* [Getting the ID for the last inserted record with tMysqlLastInsertId](https://help.qlik.com/talend/en-US/components/8.0/mysql/tmysqlconnection-tmysqllastinsertid-tlogrow-getting-id-for-last-inserted-record-with-tmysqllastinsertid-standard-component-the)
* [Inserting data in mother/daughter tables](https://help.qlik.com/talend/en-US/components/8.0/mysql/tmysqlconnection-tmysqlrollback-tfileinputdelimited-inserting-data-in-mother-daughter-tables-standard-component-the)
* [Iterating on a DB table and listing its column names](https://help.qlik.com/talend/en-US/components/8.0/mysql/tmysqltablelist-tmysqlconnection-tlogrow-iterating-on-db-table-and-listing-its-column-names-standard-component-the)
* [Iterating on DB tables and deleting their content using a user-defined SQL template](https://help.qlik.com/talend/en-US/components/8.0/mysql/tmysqlconnection-tmysqltablelist-tmysqltablelist-iterating-on-db-tables-and-deleting-their-content-using-user-defined-sql-template-standard-component-the)
* [Sharing a database connection between a parent Job and child Job](https://help.qlik.com/talend/en-US/components/8.0/mysql/tmysqlconnection-tmysqlinput-tlogrow-sharing-database-connection-between-parent-job-and-child-job-standard-component-this)