# Configuring the components

## Procedure

1. Double-click the first tMysqlConnection component to show its Basic settings view, and set the connection details. For more information on the configuration of tMysqlConnection, see [tMysqlConnection](https://help.qlik.com/talend/en-US/components/8.0/mysql/tmysqlconnection).

   Note that we use this component to open a connection to a MySQL databased named *project\_q1*.

   ![](https://help.qlik.com/talend/en-US/components/8.0/Resources/images/use_case-tmysqlinput-dynamic_connection-2.png)
2. Configure the second tMysqlConnection component in the same way, but fill the Database field with *project\_q2* because we want to use this component to open a connection to another MySQL database, *project\_q2*.

   ![](https://help.qlik.com/talend/en-US/components/8.0/Resources/images/use_case-tmysqlinput-dynamic_connection-3.png)
3. Double-click the tMysqlInput component to show its Basic settings view.

   ![](https://help.qlik.com/talend/en-US/components/8.0/Resources/images/use_case-tmysqlinput-dynamic_connection-4.png)
4. Select the Use an existing connection check box, and leave the Component List box as it is.
5. Click the [...] button next to Edit schema to open the Schema dialog box and define the data structure of the database table to read data from.

   ![](https://help.qlik.com/talend/en-US/components/8.0/Resources/images/use_case-tmysqlinput-dynamic_connection-5.png)

   In this example, the database table structure is made of four columns, *id* (type Integer, 2 characters long), *firstName* (type String, 15 characters long), *lastName* (type String, 15 characters long), and *city* (type String, 15 characters long). When done, click OK to close the dialog box and propagate the schema settings to the next component.
6. Fill the Table field with the database table name, *customers* in this example, and click Guess Query to generate the query statement corresponding to your table schema in the Query field.
7. In the Dynamic settings view, click the [+] button to add a row in the table, and fill the Code field with the code script of the context variable you just created, " + context.myConnection + " in this example.

   ![](https://help.qlik.com/talend/en-US/components/8.0/Resources/images/use_case-tmysqlinput-dynamic_connection-6.png)
8. In the Basic settings view of the tLogRow component, select the Table option for better display effect of the Job execution result.

   ![](https://help.qlik.com/talend/en-US/components/8.0/Resources/images/use_case-tmysqlinput-dynamic_connection-7.png)
9. In the Dynamic settings view of the tMysqlClose component, do exactly the same as in the Dynamic settings view of the tMysqlInput component.