MySQL
MySQL
You can add MySQL as a data source infrastructure component in the following ways:
- Configure a new connection. See Create new connection - configuration details.
- Import an existing connection from a project or catalog/database that is on the same cluster. See Importing an existing connection.
Create new connection - configuration details
| Field | Description |
|---|---|
| Target persistence |
Select the target persistence:
|
| Display name | The name of the new infrastructure component. |
| Database name | Enter the name of your database. |
| Hostname | Enter the Hostname. |
| Port | Enter the Port number. |
| Username | Enter the Username. |
| Password | Enter the Password. |
| Port is SSL enabled | Use the toggle switch to enable or disable SSL connection. If enabled, i. The Upload SSL certificate (.pem, .crt, .cert, or .cer) link is enabled. ii. Click the Upload SSL certificate (.pem, .crt, .cert, or .cer) link. iii. Browse the SSL certificate and upload. |
| Validate certificate | Use the toggle switch to enable or disable the Validate certificate option. Enable it to validate whether the SSL certificate that is returned by the host is trusted or not. |
| Connection status | Click the Test connection link to test the database connection. If the database connection is successful, a success message appears. |
Console UI Associate catalog |
Console UI Select the checkbox to add a catalog for your storage. This catalog is associated with your storage and serves as your query interface with the data stored within. |
| Catalog name / Name |
|
| Create |
|
Importing an existing connection
| Field | Description |
|---|---|
| Select the location of the existing connection |
Select from where to import the connection:
Important: Connections can only be imported from catalogs, databases, or projects that
are on the same cluster. Catalogs, databases, or projects created in a different cluster within the
data platform cannot be imported.
|
| Select data source | Use the dropdown to select a data source from the selected catalog, database, or project. |
| Target persistence |
Select the target persistence:
|
| Display name | The name of the new infrastructure component. |
Console UI Associate catalog |
Console UI Select the checkbox to add a catalog for your storage. This catalog is associated with your storage and serves as your query interface with the data stored within. |
| Catalog name / Name |
|
| Create | Click Create to create the database. |
Bring Your Own JAR (BYOJ) process
- Log in to the IBM® watsonx.data console.
- From the navigation menu, go to the Configurations page and click the Driver manager tile.
- Click Add driver.
- Upload the MySQL JAR and specify the driver version. Currently, only one JAR (mysql-connector-j-8.2.0.jar) is supported for MySQL data source.
- Click Add. After the driver is successfully added, it undergoes a series of validation. If the validation is successful, it is set to 'inactive' status otherwise it is set to 'failed' status.
- Click the vertical ellipsis icon to assign or delete the driver.
- To assign the driver to an engine:
- Click Assign.
- Select one or more engines to assign the driver. When assigned, the driver is set to 'active'
status.Note: You can link the MySQL data source to the engine only when a driver is associated to that engine. Only one MySQL driver can be associated to an engine at a time.
- To unassign a driver from an engine, users must first introduce another driver.
- Click Save and restart engine.
- In the Infrastructure manager, hover over the MySQL data source and click the Manage associations icon.
- Select the engine to modify the catalog's association with it. All in-flight queries on the modified engines are stopped.
- Click Save and restart engine.
Vulnerabilities in JAR
As part of the BYOJ process, users can upload the required JAR files. If a vulnerability is identified in a JAR, a grace period is set for the removal and cleanup activities based on the severity of the security vulnerability as shown in the following table:
| Severity of vulnerability | Grace period (in days) |
|---|---|
| Critical | 30 |
| High | 60 |
| Medium | 120 |
| Low | 180 |
The grace period is calculated from the date the vulnerability is reported, plus the specified grace period. Multiple warnings are displayed to the users about the grace period in the Driver manager page (for the admin) as well as in other places like in the ‘Catalogs’ section in the ‘Infrastructure manager’ page and in the ‘Catalogs associated’ section in the ‘Data manager page’. For example, if a customer uses the mysql-connector-j-8.2.0.jar and a critical vulnerability is identified on October 1st, a cleanup process begins immediately after October 31st. This process deletes the driver from the bucket and Presto pods, disassociates the catalog from the engine, disassociates the driver in the Driver Manager page, and deletes the entry.
Limitations for SQL statements
- Only
CREATE TABLE ASis supported forCREATE TABLEstatement. DROP TABLEstatement is supported only when enabled in catalog.- For the database-based catalogs,
CREATE SCHEMA,CREATE TABLE,DROP SCHEMA,DROP TABLE,DELETE,DROP VIEW,ALTER TABLE, andALTER SCHEMAstatements are not available in the Data manager UI.
Limitations for data types
BLOBandCLOBdata types supportSELECTstatement but do not support operations such asequal,like, andin.BINARYdata type supports onlySELECTstatement.- The data that is shown for the
BLOBdata type from the UI is in Base64 format, while the result from presto-cli is in hexadecimal format. - The data that is shown for the
BINARYdata type from the UI is in Base64 format, while the result from presto-cli is in hexadecimal format. - You can use
CLOBdata type as an equivalent alternative toLONGTEXT. - When the fields of data type
REALhave 6 digits or more in the decimal part with the digits being predominately zero, the values when queried are rounded off. It is observed that the rounding off occurs differently based on the precision of the values. For example, a decimal number 1.654 when rounded to 3-digits after the decimal point are the same. Another example is 10.890009 and 10.89000. It is noticed that 10.89000 is rounded to 10.89, whereas 10.89009 is not rounded off. This is an inherent issue because of the representational limitations of binary floating point formats. This might have a significant impact when querying involves sorting.