Skip to main content
These tools provide comprehensive MySQL database management capabilities, including creation, deployment, lifecycle management, and configuration. MySQL tools mirror PostgreSQL functionality with MySQL-specific features like root password management.

Core Database Operations

Creates a new MySQL database in Dokploy.Annotations:
  • Destructive: false
  • Idempotent: false
  • External API: true
name
string
required
The name of the MySQL database.
appName
string
required
The app name for the MySQL database.
databaseName
string
required
The name of the database to create.
databaseUser
string
required
The username for database access.
databasePassword
string
required
The password for database access. Must match pattern: ^[a-zA-Z0-9@#%^&*()_+\-=[\]{}|;:,.<>?~\]*$`
databaseRootPassword
string
required
The root password for MySQL. Must match pattern: ^[a-zA-Z0-9@#%^&*()_+\-=[\]{}|;:,.<>?~\]*$`
environmentId
string
required
The ID of the environment where the database will be created.
dockerImage
string
default:"mysql:8"
Docker image to use for MySQL.
description
string
An optional description for the database.
serverId
string
The ID of the server where the database will be deployed.
Example:
{
  "name": "production-mysql",
  "appName": "prod-mysql",
  "databaseName": "myapp",
  "databaseUser": "appuser",
  "databasePassword": "UserPass123!",
  "databaseRootPassword": "RootPass456!",
  "environmentId": "env_abc123",
  "dockerImage": "mysql:8",
  "description": "Production MySQL database"
}
Response:
{
  "message": "MySQL database \"production-mysql\" created successfully",
  "data": {
    "mysqlId": "mysql_xyz789",
    "name": "production-mysql",
    "appName": "prod-mysql",
    "databaseName": "myapp"
  }
}
MySQL requires both a user password and a root password. The root password provides full administrative access.
Gets a specific MySQL database by its ID in Dokploy.Annotations:
  • Destructive: false
  • Idempotent: true
mysqlId
string
required
The ID of the MySQL database to retrieve.
Example:
{
  "mysqlId": "mysql_xyz789"
}
Response:
{
  "message": "MySQL database retrieved successfully",
  "data": {
    "mysqlId": "mysql_xyz789",
    "name": "production-mysql",
    "appName": "prod-mysql",
    "databaseName": "myapp",
    "databaseUser": "appuser",
    "dockerImage": "mysql:8",
    "applicationStatus": "running",
    "externalPort": 3306
  }
}
Updates an existing MySQL database in Dokploy.Annotations:
  • Destructive: true
mysqlId
string
required
The ID of the MySQL database to update.
name
string
The new name of the MySQL database.
appName
string
The new app name of the MySQL database.
databaseName
string
The new database name.
databaseUser
string
The new database username.
databasePassword
string
The new database password.
databaseRootPassword
string
The new root password for MySQL.
description
string
The new description for the MySQL database.
dockerImage
string
default:"mysql:8"
The new Docker image for MySQL.
command
string
Custom command to run the MySQL database.
env
string
Environment variables for the MySQL database.
memoryReservation
string
Memory reservation for the MySQL database (e.g., “512m”, “1g”).
memoryLimit
string
Memory limit for the MySQL database (e.g., “1g”, “2g”).
cpuReservation
string
CPU reservation for the MySQL database (e.g., “0.5”, “1”).
cpuLimit
string
CPU limit for the MySQL database (e.g., “1”, “2”).
externalPort
number
External port for the MySQL database.
applicationStatus
enum
Application status: idle, running, done, or error.
Example:
{
  "mysqlId": "mysql_xyz789",
  "memoryLimit": "2g",
  "cpuLimit": "2",
  "externalPort": 3307
}
This operation is destructive. Changing certain parameters may require redeployment.
Removes/deletes a MySQL database from Dokploy.Annotations:
  • Destructive: true
mysqlId
string
required
The ID of the MySQL database to remove.
Example:
{
  "mysqlId": "mysql_xyz789"
}
This operation is destructive and cannot be undone. All data in the database will be permanently deleted.
Moves a MySQL database to a different project.Annotations:
  • Destructive: true
mysqlId
string
required
The ID of the MySQL database to move.
targetProjectId
string
required
The ID of the project to move the database to.
Example:
{
  "mysqlId": "mysql_xyz789",
  "targetProjectId": "proj_new123"
}
Moving a database to a different project may affect connected applications.

Lifecycle Management

Deploys a MySQL database in Dokploy.Annotations:
  • Destructive: false
  • Idempotent: false
mysqlId
string
required
The ID of the MySQL database to deploy.
Example:
{
  "mysqlId": "mysql_xyz789"
}
Response:
{
  "message": "MySQL database deployed successfully"
}
Starts a MySQL database in Dokploy.Annotations:
  • Destructive: true
mysqlId
string
required
The ID of the MySQL database to start.
Example:
{
  "mysqlId": "mysql_xyz789"
}
Stops a MySQL database in Dokploy.Annotations:
  • Destructive: true
mysqlId
string
required
The ID of the MySQL database to stop.
Example:
{
  "mysqlId": "mysql_xyz789"
}
Stopping the database will make it unavailable to connected applications.
Reloads a MySQL database in Dokploy.Annotations:
  • Destructive: true
mysqlId
string
required
The ID of the MySQL database to reload.
appName
string
required
The app name of the MySQL database.
Example:
{
  "mysqlId": "mysql_xyz789",
  "appName": "prod-mysql"
}
Rebuilds a MySQL database in Dokploy.Annotations:
  • Destructive: true
mysqlId
string
required
The ID of the MySQL database to rebuild.
Example:
{
  "mysqlId": "mysql_xyz789"
}
Rebuilding will recreate the database container. Ensure data is persisted via volumes.

Configuration Management

Changes the status of a MySQL database.Annotations:
  • Destructive: true
mysqlId
string
required
The ID of the MySQL database.
applicationStatus
enum
required
The new status: idle, running, done, or error.
Example:
{
  "mysqlId": "mysql_xyz789",
  "applicationStatus": "running"
}
Saves external port configuration for a MySQL database.Annotations:
  • Destructive: true
mysqlId
string
required
The ID of the MySQL database.
externalPort
number
required
External port for the MySQL database. Set to null to disable external access.
Example:
{
  "mysqlId": "mysql_xyz789",
  "externalPort": 3306
}
Disable External Access:
{
  "mysqlId": "mysql_xyz789",
  "externalPort": null
}
Saves environment variables for a MySQL database in Dokploy.Annotations:
  • Destructive: true
mysqlId
string
required
The ID of the MySQL database to save environment for.
env
string
Environment variables to save for the MySQL database.
Example:
{
  "mysqlId": "mysql_xyz789",
  "env": "MYSQL_INITDB_SKIP_TZINFO=1\nMYSQL_MAX_CONNECTIONS=200"
}

Common Workflows

Creating and Deploying a MySQL Database

// Step 1: Create the database
{
  "tool": "mysql-create",
  "input": {
    "name": "myapp-mysql",
    "appName": "myapp-mysql",
    "databaseName": "appdata",
    "databaseUser": "appuser",
    "databasePassword": "UserPass123!",
    "databaseRootPassword": "RootPass456!",
    "environmentId": "env_abc123"
  }
}

// Step 2: Deploy the database
{
  "tool": "mysql-deploy",
  "input": {
    "mysqlId": "mysql_xyz789"
  }
}

// Step 3: Configure external access
{
  "tool": "mysql-saveExternalPort",
  "input": {
    "mysqlId": "mysql_xyz789",
    "externalPort": 3306
  }
}

Migrating from MySQL 5.7 to MySQL 8

// Step 1: Stop the database
{
  "tool": "mysql-stop",
  "input": {
    "mysqlId": "mysql_xyz789"
  }
}

// Step 2: Update the Docker image
{
  "tool": "mysql-update",
  "input": {
    "mysqlId": "mysql_xyz789",
    "dockerImage": "mysql:8"
  }
}

// Step 3: Rebuild and start
{
  "tool": "mysql-rebuild",
  "input": {
    "mysqlId": "mysql_xyz789"
  }
}

Updating Resource Limits

{
  "tool": "mysql-update",
  "input": {
    "mysqlId": "mysql_xyz789",
    "memoryLimit": "4g",
    "memoryReservation": "2g",
    "cpuLimit": "2",
    "cpuReservation": "1"
  }
}

MySQL vs PostgreSQL

The key difference between MySQL and PostgreSQL tools in Dokploy is the databaseRootPassword parameter:
  • MySQL: Requires both databasePassword (for the application user) and databaseRootPassword (for root administrative access)
  • PostgreSQL: Only requires databasePassword (the postgres superuser uses this password)
When connecting your application to MySQL, use the databaseUser and databasePassword, not the root credentials.

Build docs developers (and LLMs) love