{
  "manifest_version": "1.0.0",
  "template": {
    "id": "466cf28d-cb81-497e-b06e-217f75cfa84f",
    "slug": "mysql-server",
    "name": "MySQL Server",
    "description": "Production-ready MySQL with persistent storage and TCP access.",
    "url": "https://railway.com/deploy/mysql-server",
    "upstream": {
      "image": "mysql:latest"
    }
  },
  "services": [
    {
      "name": "mysql",
      "source": {
        "image": "mysql:latest"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/mysql",
      "tcp_ports": [
        3306
      ],
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "MYSQLHOST",
      "service": "mysql",
      "description": "Private Railway hostname for internal connections",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "MYSQLPORT",
      "service": "mysql",
      "description": "Internal MySQL TCP port",
      "secret": false,
      "strategy": "default",
      "default": "3306"
    },
    {
      "key": "MYSQLUSER",
      "service": "mysql",
      "description": "Application username used by client applications",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "MYSQL_USER",
      "service": "mysql",
      "description": "Application database user created on first initialization",
      "secret": false,
      "strategy": "default",
      "default": "mysql"
    },
    {
      "key": "DATABASE_URL",
      "service": "mysql",
      "description": "Private MySQL connection URL",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "MYSQLDATABASE",
      "service": "mysql",
      "description": "Default database used by client applications",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "MYSQLPASSWORD",
      "service": "mysql",
      "description": "Application password used by client applications",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "MYSQL_DATABASE",
      "service": "mysql",
      "description": "Default application database created on first initialization",
      "secret": false,
      "strategy": "default",
      "default": "app"
    },
    {
      "key": "MYSQL_PASSWORD",
      "service": "mysql",
      "description": "Password for the application database user",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "RAILWAY_RUN_UID",
      "service": "mysql",
      "description": "Run as root to ensure Railway volume write permissions",
      "secret": false,
      "strategy": "default",
      "default": "0"
    },
    {
      "key": "DATABASE_PUBLIC_URL",
      "service": "mysql",
      "description": "Public MySQL connection URL via Railway TCP Proxy",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "MYSQL_ROOT_PASSWORD",
      "service": "mysql",
      "description": "Root administrator password",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "mysql-server"
      }
    },
    "cli": "railway deploy --template mysql-server",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "466cf28d-cb81-497e-b06e-217f75cfa84f",
            "serializedConfig": {
              "services": {
                "47631926-772d-40ba-819d-e1e24c758bb9": {
                  "icon": "https://devicons.railway.com/i/mysql.svg",
                  "name": "mysql",
                  "source": {
                    "image": "mysql:latest"
                  },
                  "variables": {
                    "MYSQLHOST": {
                      "description": "Private Railway hostname for internal connections",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "MYSQLPORT": {
                      "description": "Internal MySQL TCP port",
                      "defaultValue": "3306"
                    },
                    "MYSQLUSER": {
                      "description": "Application username used by client applications",
                      "defaultValue": "${{MYSQL_USER}}"
                    },
                    "MYSQL_USER": {
                      "description": "Application database user created on first initialization",
                      "defaultValue": "mysql"
                    },
                    "DATABASE_URL": {
                      "description": "Private MySQL connection URL",
                      "defaultValue": "mysql://${{MYSQL_USER}}:${{MYSQL_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:3306/${{MYSQL_DATABASE}}"
                    },
                    "MYSQLDATABASE": {
                      "description": "Default database used by client applications",
                      "defaultValue": "${{MYSQL_DATABASE}}"
                    },
                    "MYSQLPASSWORD": {
                      "description": "Application password used by client applications",
                      "defaultValue": "${{MYSQL_PASSWORD}}"
                    },
                    "MYSQL_DATABASE": {
                      "description": "Default application database created on first initialization",
                      "defaultValue": "app"
                    },
                    "MYSQL_PASSWORD": {
                      "description": "Password for the application database user",
                      "defaultValue": "{{MYSQL_PASSWORD}}"
                    },
                    "RAILWAY_RUN_UID": {
                      "description": "Run as root to ensure Railway volume write permissions",
                      "defaultValue": "0"
                    },
                    "DATABASE_PUBLIC_URL": {
                      "description": "Public MySQL connection URL via Railway TCP Proxy",
                      "defaultValue": "mysql://${{MYSQL_USER}}:${{MYSQL_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/${{MYSQL_DATABASE}}"
                    },
                    "MYSQL_ROOT_PASSWORD": {
                      "description": "Root administrator password",
                      "defaultValue": "{{MYSQL_ROOT_PASSWORD}}"
                    }
                  },
                  "networking": {
                    "tcpProxies": {
                      "3306": {}
                    }
                  },
                  "volumeMounts": {
                    "47631926-772d-40ba-819d-e1e24c758bb9": {
                      "mountPath": "/var/lib/mysql"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 1,
    "needs_volume": true
  },
  "generated_at": "2026-09-20T16:14:49.616Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-19T13:24:47.988Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_5adb2496ba274073b801",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 54,
    "typical_build_seconds": 0,
    "typical_start_seconds": 10,
    "slowest_service": "mysql"
  }
}
