EasypanelDocs

MySQL Service

Run and operate a persistent MySQL database.

The MySQL service runs the official MySQL Docker image with persistent storage, generated credentials, connection URLs, optional browser administration tools, scheduled backups, and resource controls.

Create a MySQL service

  1. Open a project and select New Service.
  2. Select MySQL and enter a service name.
  3. Optionally set the database name, user, passwords, and Docker image.
  4. Create the service and wait for it to start.
  5. Open Credentials and copy the internal connection URL into the application that needs the database.

When omitted, the database name defaults to the project name, the user defaults to mysql, and Easypanel generates the user and root passwords. Leaving the image empty uses Easypanel's default official MySQL image.

Overview

The overview provides start, stop, logs, notes, and destroy actions. Its Shell menu can open Bash or a MySQL client already configured with the service user and password.

The page also shows runtime metrics, recent logs, detected errors, and two optional administration tools:

  • phpMyAdmin provides a MySQL-focused browser interface.
  • DbGate provides a general database browser.

Enable a tool only when needed and disable it afterward. Easypanel gives each tool a generated access token and a dedicated domain.

Credentials

The Credentials tab shows:

  • user and user password;
  • database name and root password;
  • internal host and port 3306;
  • internal connection URL;
  • external host, port, and connection URL when the service is exposed.

Services in the same Easypanel project should use the internal connection URL. The internal host is derived from the project and service names and is reachable on the private service network.

Select Edit to change both the user password and root password. Easypanel updates the database accounts and redeploys connected phpMyAdmin or DbGate tools. Update every application that uses the old credentials.

The current credential rotation flow targets the default mysql account. Do not use it for a service created with a custom username.

A connection URL contains the database password. Store it as an environment variable and do not include it in source control or logs.

Expose

MySQL is private by default. The Expose tab publishes it on the server so that an external database client can connect. Saving the exposed port restarts the service and adds external values to the Credentials tab.

Prefer the internal connection for applications hosted in Easypanel. If remote access is required, restrict the port with the server or provider firewall and use a unique published port.

Backups

The Backups tab creates logical database backups in a configured storage provider. A backup configuration includes:

  • database name;
  • enabled state and cron schedule;
  • retention count;
  • storage provider and destination path.

You can run a backup immediately, edit or remove its schedule, restore a backup file, and review the backup action log. Configure the destination first under the server's storage provider settings.

Test a manual backup and restore on non-production data before relying on a schedule. See Database Backups for destination setup, retention behavior, and restore precautions.

Resources

Configure memory reservations and limits in MB, and CPU reservations and limits in cores. Set a value to 0 for unlimited resources. Saving these settings restarts the service.

Leave headroom for imports, index creation, backups, and peak query load. An aggressive memory limit can terminate MySQL and interrupt writes.

Advanced

Advanced settings can override the Docker image and command, add environment variables, and provide the contents of /etc/mysql/conf.d/easypanel.cnf.

Use .env syntax for additional environment variables and valid MySQL option file syntax for the config file. Saving Advanced settings redeploys the database.

Image, command, environment, and config changes can prevent MySQL from starting or make an existing data directory incompatible. Take a verified backup before changing the image version or storage-related options.

Data and deletion

MySQL stores its data on the server at:

/etc/easypanel/projects/[project]/[service]/data

The directory is mounted at /var/lib/mysql in the container. Destroying the service permanently removes its database files and configuration. Verify an external backup before confirming deletion.