Skip to main content

Config for mysql

Jobs that use the mysql adaptor may require authentication. A "credential" for the mysql adaptor will follow the schema below. When using the CLI, you can set up your own state.configuration by using the sample below.

Sample Configuration

Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

{
"host": "some-host-url.compute-1.amazonaws.com",
"port": "3306",
"database": "demo-db",
"user": "admin-demo",
"password": "@super(!)Secretpass"
}

Full Schema

The full configuration schema describes each attribute of the credential and notes those that are required.

{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"host": {
"title": "Host URL",
"type": "string",
"description": "The database instance host URL",
"format": "string",
"minLength": 1,
"examples": [
"some-host-url.compute-1.amazonaws.com"
]
},
"port": {
"title": "Port",
"type": "integer",
"default": 3306,
"description": "Database instance port",
"minLength": 1,
"examples": [
3306
]
},
"database": {
"title": "Database",
"type": "string",
"description": "The database name",
"minLength": 1,
"examples": [
"demo-db"
]
},
"user": {
"title": "Username",
"type": "string",
"description": "The username to log in the database",
"minLength": 1,
"examples": [
"admin-demo"
]
},
"password": {
"title": "Password",
"type": "string",
"description": "The password to log in the database",
"writeOnly": true,
"minLength": 1,
"examples": [
"@super(!)Secretpass"
]
}
},
"type": "object",
"additionalProperties": true,
"required": [
"host",
"database",
"user",
"password"
]
}