Configure MySQL Database
Virtual Client has dependency components that can be added to a workload or monitor profile to create and configure a MySQL database on the system. The following section illustrates the details for integrating this into the profile.
Preliminaries
Reference the following documentation before proceeding.
Supported Platform/Architectures
- linux-x64
- linux-arm64
- win-x64
- win-arm64
Profile Component Parameters
The following section describes the parameters used by the individual component in the profile.
Parameter | Required | Description |
---|---|---|
Action | Yes | Informs of action to take on server configuration. |
DatabaseName | Yes | Name of database used by the workload. |
Scenario | No | Name for telemetry purpose. Does not change functionality. |
Actions
The following section describes the different options for the 'Action' parameter noted above.
Action | Description |
---|---|
StartDatabaseServer | Starts the MySQL server. |
CreateDatabase | Creates a database under <Database Name> in the MySQL server. |
RaisedStatementCount | Increases number of statements MySQL can prepare (only recommended for larger VMs). |
ConfigureNetwork | Modifies the configuration file to make MySQL server accessible to the private network of VMs. |
CreateUser | Creates user access to the server for each client VM in the provided environment layout. |
Example
Here is the usage of the dependency by the Sysbench OLTP workload as an example, that uses all three actions to configure the server.
{
"Type": "MySQLServerConfiguration",
"Parameters": {
"Scenario": "StartDatabaseServer",
"Action": "StartServer",
"DatabaseName": "$.Parameters.DatabaseName",
"Role": "Server"
}
},
{
"Type": "MySQLServerConfiguration",
"Parameters": {
"Scenario": "CreateDatabase",
"Action": "CreateDatabase",
"DatabaseName": "$.Parameters.DatabaseName",
"Role": "Server"
}
},
{
"Type": "MySQLServerConfiguration",
"Parameters": {
"Scenario": "RaisedStatementCount",
"Action": "RaisedStatementCount",
"DatabaseName": "$.Parameters.DatabaseName",
"Role": "Server"
}
},
{
"Type": "MySQLServerConfiguration",
"Parameters": {
"Scenario": "ConfigureNetwork",
"Action": "ConfigureNetwork",
"DatabaseName": "$.Parameters.DatabaseName",
"Role": "Server"
}
},
{
"Type": "MySQLServerConfiguration",
"Parameters": {
"Scenario": "CreateUser",
"Action": "CreateUser",
"DatabaseName": "$.Parameters.DatabaseName",
"Role": "Server"
}
}