MySQL connections
DataMasque masks MySQL tables in place.
- Required privileges
- Connection parameters
- Encrypted connections
- Supported data types
- Unsupported key columns
Required privileges
A DataMasque connection for MySQL requires:
CREATE TEMPORARY TABLESprivileges to the database.CREATE,DROP,INDEX,SELECT,UPDATE,INSERT,ALTERandREFERENCESprivileges to the target tables.
GRANT CREATE TEMPORARY TABLES ON <target database>.* TO <connection user>@<DataMasque host>;
GRANT CREATE, SELECT, UPDATE, INSERT, ALTER, REFERENCES ON <target database>.<target tables> TO <connection user>@<DataMasque host>;
Connection parameters
For MySQL databases, the following fields are optional:
| MySQL SSL Certificate | Choose an SSL Certificate to verify the server's certificate. These can be uploaded using the Files interface. |
| TLS | How DataMasque uses TLS: Prefer (default), Require or Off. See Encrypted connections. |
Encrypted connections
DataMasque supports encrypted connections to MySQL and MariaDB databases.
The TLS field on the connection chooses how DataMasque connects:
TLS |
Behaviour |
|---|---|
Prefer (default) |
Uses TLS when the server offers it, and connects without TLS when it does not (the run log then gets a TLS fallback warning). A failed TLS handshake fails the connection. |
Require |
Connects only over TLS. The connection fails if the server does not offer TLS. No warning is written. |
Off |
Connects without TLS. No warning is written. |
Without an SSL certificate, DataMasque does not verify the server's certificate.
To verify the server, upload SSL certificates through the Files interface
and select them on the connection.
With an SSL certificate selected,
Prefer and Require both verify the server certificate against the certificate authority file (VERIFY_CA)
and the connection fails rather than connect without encryption.
Off is refused when an SSL certificate is selected:
remove the certificate or choose Require.
Connections saved before this field existed behave as Prefer.
Certificates must be uploaded as a .zip file containing the following file(s).
| File Name | Description |
|---|---|
| ca.pem | The Certificate Authority (CA) file. |
| client-cert.pem (optional) | The client public key certificate file. |
| client-key.pem (optional) | The client private key file. |
Depending on the server configuration, client-cert.pem and client-key.pem may not be required.
For example, AWS RDS requires only the Certificate Authority file.
For more information on configuring MySQL to use encrypted connections, see here: https://dev.mysql.com/doc/refman/8.0/en/using-encrypted-connections.html.
For more information on configuring MariaDB to use encrypted connections, see here: https://mariadb.com/kb/en/secure-connections-overview/.
Supported data types
The following MySQL and MariaDB data types are supported.
| Data type | Description |
|---|---|
| char(n) | Fixed-length character data of n size. |
| varchar(n) | Variable-length character data of n size. |
| text | 32 bit string value. |
| decimal, numeric | Numerical value with decimal precision. |
| tinyint | 8 bit integer value. |
| smallint | 16 bit integer value. |
| mediumint | 24 bit integer value. |
| int | 32 bit integer value. |
| bigint | 64 bit integer value. |
| float | 32 bit floating point value. |
| double | 64 bit floating point value. |
| date | Date value with no time. |
| datetime, timestamp | Date value with a time. |
| time | Time value. |
| json | For storing JSON (JavaScript Object Notation) data. |
Important! MySQL
autoincrementprimary keys are not currently supported for themask_unique_keytask type.
Unsupported key columns
| Data Type | Unsupported Format |
|---|---|
| decimal | All |
| numeric | All |
| float | All |