MySQL

Published

Updated

🐬

Tables, rows and truths.

The MySQL component adds a MySQL 8 database to a fortrabbit environment. It is optional, scales in plans by storage, with memory of its own from XL up, and can autoscale with the data.

Most CMS, such as WordPress and Craft CMS, keep their content in MySQL.

Booking MySQL

MySQL is optional. Each environment can book one MySQL component with one database. MySQL is the only database fortrabbit offers.

Configuration

With MySQL booked, the environment gets MySQL settings and metrics in the dashboard. See MySQL for access, import and export.

Scaling

MySQL plans differ in storage. Up to LG they share memory, from XL up each plan has memory of its own. The number of connections comes with the PHP plan. As a rule of thumb, scale both together: PHP XS with MySQL XS, PHP SM with MySQL SM. See database performance.

When autoscaling is enabled, smaller and larger plans are automatically booked, based on MySQL storage usage. Autoscaling stops at LG: the dedicated plans from XL up are booked by hand. With autoscaling off, a full database stops accepting new rows, see missing INSERT privileges. Scale the plan or clean up the database.

Why MySQL storage grows

The database grows as the app writes rows. The metrics show how fast. Unwanted growth often comes from:

  • Logs written to tables
  • Revisions kept for every entry
  • Bots that create entries, such as spam comments or search logs

Cleaning up the database

Before scaling up, check what fills the database: find the large tables, delete rows that are not needed, and fix the code or config that wrote them. The metric shows the new size after a few minutes.

Without MySQL

Flat-file CMS such as Kirby, Statamic and Grav run without a database, and so do apps that only talk to APIs. Leave MySQL off for them.

Written by humans and AI in collaboration.

AI use & editorial processEdit on GitHub ↗