The Radius.Data/mySqlDatabases resource type represents a MySQL database. It allows developers to create and easily connect to a MySQL database as part of their Radius applications. The developer provides the administrator username and password directly on the resource; the password property is marked x-radius-sensitive, so Radius encrypts it at rest, redacts it on reads, and injects it decrypted only into the platform's Recipe.
Developer documentation is embedded in the resource type definition YAML file and is accessible via the rad resource-type show Radius.Data/mySqlDatabases command.
| Property | Type | Access | Description |
|---|---|---|---|
environment |
string | Required | The Radius Environment ID. Typically set by the rad CLI. |
application |
string | Optional | The Radius Application ID. |
username |
string | Required | The administrator username for the MySQL database. Passed to the Recipe as {{context.resource.properties.username}}. |
password |
string (x-radius-sensitive) |
Required | The administrator password. Encrypted at rest, redacted on reads, and injected decrypted into the Recipe as {{context.resource.properties.password}}. |
database |
string | Optional | The name of the database. Defaults to mysql_db. |
version |
string (5.7, 8.0, 8.4) |
Optional | The major MySQL server version. Defaults to 8.4. |
host |
string | Read only | The host name used to connect to the database. Set from the Recipe module's output. |
port |
integer | Read only | The port number used to connect to the database. Set from the Recipe module's output. |
sslMode |
string (required, disabled) |
Read only | Whether the database requires an encrypted (TLS/SSL) connection. The Kubernetes and AWS Recipes set this to disabled. The Azure Recipe Pack keeps require_secure_transport ON by default and does not set this property; override the Recipe Pack's mySqlServerConfigurations parameter to disable it if you want Azure to match. |
Recipes for this resource type are provided through the platform Recipe Packs at the repository root under recipe-packs/. A platform engineer configures an Environment by deploying the Recipe Pack for their target platform, which registers the Recipe for Radius.Data/mySqlDatabases along with the Recipes for every other Resource Type on that platform.
| Platform | Recipe Pack | Recipe source |
|---|---|---|
| Azure | recipe-packs/azure/bicep-recipepack.bicep |
Direct module — Azure Verified Module avm/res/db-for-my-sql/flexible-server |
Add a mySqlDatabases resource to your application and connect a container to it. Radius injects the database's connection properties into the container as environment variables named CONNECTION_<CONNECTION-NAME>_<PROPERTY-NAME> (for example CONNECTION_MYSQLDB_HOST, CONNECTION_MYSQLDB_PORT, CONNECTION_MYSQLDB_DATABASE, and CONNECTION_MYSQLDB_SSLMODE). See test/app.bicep for a complete example.