- Connect to your MySQL Server from MySQL Workbench.
- Use MySQL Workbench to create a new database table with Transparent Data Encryption (TDE) enabled. This generates an AES-256 key on the CryptoHub that serves as the master encryption key for MySQL TDE.
- Insert example data into the table and list the contents to verify that the data is decrypted transparently.
- Confirm that you can successfully rotate the master encryption key stored on the CryptoHub.
Connect to MySQL Server
Perform the following steps to connect to your MySQL Server instance using MySQL Workbench:1
L Start the program on your computer to open the initial MySQL Workbench dashboard.
2
On the MySQL Workbench dashboard, go to MySQL Connections and select the [+] button.
3
In the Setup New Connection window, input the details of your MySQL server connection.
| Option | Description or required configuration |
|---|---|
| Connection Name | A label for your reference. |
| Connection Method | Typically, select Standard (TCP/IP) to connect to a standard MySQL server. Other methods, such as TCP/IP over SSH or a local socket or pipes for local connections, are available. |
| Hostname | The IP address or domain name of the MySQL server you’re connecting to. You can use localhost if your MySQL server is on the same machine as your MySQL Workbench. |
| Port | The port number that the MySQL server is listening on. The default MySQL port is 3306. |
| Username | The username you use to authenticate with the MySQL server. |
| Password | If your account requires a password, select [ Store in Vault… ] to enter and save your password |
4
After you enter the preceding details, select [ Test Connection ] to ensure that your settings are correct and that MySQL Workbench can reach the MySQL server.
5
If the test succeeds, select [ OK ] to close the window and save the connection. Then, you can double-click on the saved connection to connect to your MySQL server.
Create a database table
Perform the following steps to create a new database table with TDE enabled:1
Open a new SQL tab to execute queries.
2
Run the following query to create a new encrypted table called Alternatively, you can enable encryption for an existing table by using the following SQL query:
t1 in the world schema or database, which is a sample database that comes pre-installed in MySQL:Mysql
Mysql
Insert data into the table
Perform the following steps to insert example data into the table:1
Open a new SQL tab to execute queries.
2
Run the following query to insert example data into the
t1 table:Mysql
Verify the data
Perform the following steps to verify that the data decrypts transparently:1
Open a new SQL tab to execute queries.
2
Run the following query to retrieve the data you inserted into the
t1 table:Mysql
This should return the unencrypted rows you just inserted.
Rotate the key
Perform the following steps to rotate the TDE master key:1
Open a new SQL tab to execute queries.
2
Run the following query to rotate the TDE master key:
Mysql
3
Verify the rotation by inserting some new data into your encrypted table and then retrieving it:
Mysql
If the insert and select operations succeed, MySQL can use the new key to encrypt and decrypt data.

