• Docs
  • Changelog
Sign in
Get started
    • Home
    • Your first deploy
    • Free instances
    • Platform features by plan
    • Use with coding agents
    • FAQ
    • Templates
      • Migrate from…
        • Heroku
        • Railway
    • Compute plans
    • SandboxesBeta
      • Service types
        • Which to use?
        • Static sites
        • Web services
        • Private services
        • Background workers
        • Cron jobs
        • Workflows
        • Multi-service architectures
      • Data storage
        • Render Postgres
        • Render Key Value (Redis®-compatible)
        • Persistent disks
    • How deploys work
    • Supported languages
    • Git providers (GitHub, etc.)
    • Build pipeline
    • Deploy hooks
    • Monorepo support
    • Troubleshooting deploys
      • Previewing changes
        • Single-service previews
        • Preview environments (multi-service)
      • Docker deploys
        • Overview
        • Deploy a registered image
        • Using secrets
      • Runtime
        • Native runtimes
        • Environment variables & secrets
        • Default environment variables
    • Intro to sandboxes
    • Limits
      • How to…
        • Create & configure sandboxes
        • Execute commands
        • Manage files
        • Manage snapshots
      • Use with…
        • Claude Managed Agents
        • Cursor Cloud Agents
        • OpenAI Agents API
      • SDK/CLI reference
        • TypeScript SDK
        • Python SDK
        • CLI commands
    • Intro to workflows
    • Tutorial
    • Limits & pricing
      • How to…
        • Define tasks
        • Define flowsNew
        • Trigger runs
        • Develop locally
      • SDK reference
        • TypeScript SDK
        • Python SDK
      • Example workflows
        • TypeScript examples
        • Python examples
    • Overview
    • Create & connect
    • Database credentials
    • Extensions
    • Version upgrades
    • Logical replication
    • Legacy instance types
      • Database recovery
        • Recovery & backups
        • High availability
      • Database performance
        • Read replicas
        • Connection pooling
        • Admin apps
        • Repacking tables
        • Troubleshooting performance
    • Regions
    • Inbound IP rules
    • Edge caching
    • WebSockets
    • TLS certificates
      • Custom domains
        • Overview
        • Cloudflare
        • Namecheap
        • Other DNS providers
      • Internal traffic
        • Private network
        • Private links
      • Outbound traffic
        • Default IP ranges
        • Dedicated IP addresses
        • Outbound bandwidth
        • Handling network changes
      • Static site config
        • Custom response headers
        • Redirects & rewrites
    • The Render Dashboard
    • SSH / Shell access
    • Projects & environments
      • Service actions
        • Scaling
        • Rollbacks
        • Maintenance mode
        • One-off jobs
      • Infrastructure as code
        • Blueprints overview
        • render.yaml reference
        • Terraform provider
    • In-dashboard metrics
    • Health checks
    • Uptime best practices
      • Logging
        • In-dashboard logs
        • Log streams (syslog/HTTPS)
      • OpenTelemetry (OTel) metrics
        • Provider setup
        • Metrics reference
      • Notifications
        • Webhooks
        • Email / Slack
    • MCP Server
      • Render CLI
        • Overview
        • Command reference
      • REST API
        • Overview
        • API reference
      • Third-party connections
        • OIDC support
        • Datadog
    • Workspaces, members, & roles
    • Login settings
    • Audit logs
      • Organizations
        • Overview
        • SAML SSO
    • DDoS protection
    • Platform maintenance
      • Compliance
        • Overview
        • HIPAA (US health data)
        • HIPAA best practices
        • Shared responsibility model
        • Pentest policy
    • Heroku vs Render
    • Vercel vs Render

Deploy MySQL

MySQL is a popular database powering many of the highest traffic sites in the world. Render Disks make it effortless to deploy production-grade MySQL on Render backed by high performance SSDs with automatic daily snapshots.

Render private services are only visible to other Render services in your workspace. They have internal URLs like mysql:3306, can speak any protocol and can listen on any port. Render automatically detects the ports for your services when they are deployed.

Let's get started!

MySQL Versions

The master branch for Render's MySQL repo runs MySQL 8. If you need MySQL 5, make sure to select the mysql-5 branch when you create your service below.

If you are using MySQL as the database for a production Ghost 5 deployment on Render, you must use MySQL 8 for your production database.

One-Click Deploy

Click Deploy to Render below and follow the prompts to set up MySQL on Render.

Deploy to Render

Manual Deploy

  1. Fork render-examples/mysql on GitHub or click the green 'Use this template' button.

  2. Create a new private service on Render, and give Render permission to access your new repo.

    Pick the mysql-5 branch in this step if you want to deploy MySQL 5.

  3. Set the service's Language field to Docker and add the following environment variables:

    KeyValue
    MYSQL_DATABASEmy_database (or your preferred database name)
    MYSQL_USERmysql (or your preferred DB username)
    MYSQL_PASSWORDA secure password for MYSQL_USER
    MYSQL_ROOT_PASSWORDA secure password for the MySQL root user
  4. Add a Disk under Advanced with the following values:

Mount Path/var/lib/mysql (required)
Size10 GB Feel free to change this to match your requirements.

The MySQL Docker image writes data to /var/lib/mysql. The Mount Path must match this exactly. Setting a different Mount Path does not change the MySQL configuration, and will result in lost data.

That's it! Save your private service to bring up MySQL which will take a few minutes to start. Future deploy should be much faster.

Your MySQL instance will be available on the displayed URL as soon as the deploy is live. The URL should look like mysql-foo:3306.

MySQL

Connecting to your database

You can connect to MySQL from other applications running in your Render workspace using the name and port for your private service. For example, you can a create a Web Service to manage your MySQL database using Adminer. See our Adminer Deployment Guide for details.

You can also use SSH or the shell in your dashboard to connect to your database.

Learn more about connecting to MySQL.

Backups

Relying on a disk snapshot to restore a database is not recommended. Restoring a disk snapshot will likely result in corrupted or lost database data.

Using a database’s recommended backup tool (for example: mysqldump) is the recommended way to backup and restore a database without corrupted or lost data.

Deploy MySQL
  • MySQL Versions
  • One-Click Deploy
  • Manual Deploy
  • Connecting to your database
  • Backups
All Systems Operational
© Render Inc. All rights reserved.