Configuring the Connection to the MySQL Database with the SQL Gateway Console

Preconditions

Before you configure the connection to the SQL database with the SQL Gateway Console, the following steps need to be executed:

  • Step 1: Set up the PC on which you intend to install the SQL Gateway.

  • Step 2: Set up your SQL database.

  • Step 3: Install the SQL Gateway.

To configure a connection to a MySQL database, you first have to configure a general Database Server for My SQL. In a second step, configure one or more Database Connections to specific MySQL databases that are accessible via the Database Server.

Configuring Access to MySQL Database Servers

This procedure describes how to define the access to a MySQL database server:

Step

Action

Remark

1

In the Configuration tab of the SQL Gateway, right-click the Database Servers node in the tree structure on the left-hand side and execute the command New Database Server.

Result: A new subnode with a default name is created.

2

Enter a unique Server Name in order to identify this database server.

3

Select My SQL from the Server Type list.

After you have selected My SQL as Server Type, the configuration parameters described in this chapter are displayed.

4

Enter the Server Address in order to identify the PC on which the database server is running.

If the MySQL server is running on the same PC as the SQL Gateway, enter localhost or a loopback IP address, such as 127.0.0.1.

If the MySQL server is running on a different PC, enter the computer name of the remote PC or the IP address.

5

As User Name, enter the login name of the MySQL user account to be used for accessing the MySQL database.

6

Enter the Password of the MySQL user account to be used for accessing the MySQL database.

7

Select the Connection Protocol to access the MySQL database server from the list.

Select the connection protocol that is used by the MySQL database server:

  • TCP communication protocol:

    Define the Port for TCP/IP communication. The default value is 3306.

  • NamedPipe communication protocol:

    Define the Pipe Name for accessing the MySQL server. The default value is MySQL.

8

Click the Test Server Connection button in order to verify whether the connection to the database server can be established with the parameters configured.

Result: A message is displayed indicating the result of the test. For further information, refer to the Troubleshooting chapter.

Configuring the Database Connections

This procedure describes how to create a connection to a specific MySQL database:

Step

Action

Result/Remark

1

In the Configuration tab of the SQL Gateway, right-click the Database Connections node in the tree structure on the left-hand side and execute the command New Database Connection.

Result: A new subnode with a default name is created.

2

Enter a unique Connection Name in order to identify this database connection.

Make sure that exactly the value of the parameter Connection Name is used in the client configuration:

The element wsDbConnectionName configured in the EcoStruxure Machine Expert SqlRemoteAccess library must have the identical value as the parameter Connection Name.

3

From the Server Name list, select the MySQL database server that hosts the MySQL database you want to connect to.

The Server Name list contains entries for those servers that are defined under the Database Servers node.

After you have selected a MySQL database server as Server Name, the configuration parameters described in this chapter are displayed.

4

Enter the Database Name of the MySQL database.

Some MySQL tools (such as MySQL Workbench) use the term Schema to refer to the database.

5

In order to add further parameters to the configuration of your MySQL database connection, click the Select button and activate the parameters of your choice in the Select Advanced Properties dialog box.

Result: After you have confirmed your selection with OK, the selected parameters will be displayed in the editor and can be configured.

6

Click the Test Database Connection button in order to verify whether the connection to the database can be established with the parameters configured.

Result: A message is displayed indicating the result of the test. For further information, refer to the Troubleshooting chapter.