MySQL
Managed MySQL on Bahriya: relational databases with per-database users, three tiers, encryption at rest, external access, phpMyAdmin and always-on backups.
Bahriya provides managed MySQL instances — a relational database deployed alongside your containers and managed from the same console, CLI and Terraform provider as everything else. An instance holds one or more logical databases, each with its own user, in every region you choose.
What you get
- MySQL 8.4 LTS, the database your ORM, migration tool and client library already speak.
- Databases and users as configuration. Declare the databases you want and the platform creates each one with a dedicated user and a generated password. Add or remove entries later and the instance converges. See Databases and users.
- Three tiers, from a single node to automatic failover. See Tiers and replication.
- Backups that are always on — a dump of every database on a schedule you set, plus binary logs shipped continuously for point-in-time recovery. See Backups and point-in-time recovery.
- Encryption at rest, chosen when you create the instance: MySQL's own encryption of tables and logs, plus an optional volume encryption add-on, with platform-managed keys and on-demand master-key rotation. See Encryption at rest.
- TLS and external access, so an application hosted elsewhere can connect over an allowlisted, encrypted connection. See External access.
- phpMyAdmin on demand, for browser access that switches itself off. See phpMyAdmin.
Creating an instance
Create instances from the console, the Reis CLI or Terraform. Each instance needs:
- Name and handle — a display name and a permanent identifier.
- Project — the project it belongs to; containers in the same project reach it over the internal network.
- Tier —
single,replicatedorha. Fixed at creation. - Plan — CPU and memory per node, chosen together as a pair.
- Storage — data storage per node, from 5 GB to 250 GB. Storage can grow but never shrink.
- At least one database, each with a user.
- Regions — one or more. Each region runs an independent copy with its own data; there is no replication between regions.
Plans
CPU and memory are sold as a pair. Every node of an instance runs the plan you choose.
| Plan | vCPU per node | Memory per node |
|---|---|---|
| 0.5 vCPU / 1 GB | 0.5 | 1 GB |
| 1 vCPU / 2 GB | 1 | 2 GB |
| 2 vCPU / 4 GB | 2 | 4 GB |
| 2 vCPU / 8 GB | 2 | 8 GB |
| 4 vCPU / 8 GB | 4 | 8 GB |
| 4 vCPU / 16 GB | 4 | 16 GB |
| 8 vCPU / 16 GB | 8 | 16 GB |
| 8 vCPU / 32 GB | 8 | 32 GB |
In the API, Reis and Terraform the plan is two fields — cpumillicores and memorymb (cpu and memory in Reis YAML) — and a pair that is not in the table is rejected. You can move between plans on a live instance; the change applies as a rolling update.
Connecting
Containers in the same project connect at the instance handle on port 3306:
<mysql-handle>:3306Use the database user and password for the database your application owns. Passwords are generated by the platform and never shown in a read — reveal them from the instance's detail page or with reis mysql:credentials. See Connecting to MySQL.
Tuning
A small set of server settings can be tuned per instance: max_connections, wait_timeout, interactive_timeout, max_allowed_packet, group_concat_max_len, innodb_flush_log_at_trx_commit, character_set_server, collation_server, sql_mode, slow_query_log and long_query_time. Anything else stays managed by the platform, including the settings point-in-time recovery depends on.
Lifecycle
Instances move through provisioning → running, and terminating → terminated when deleted. Updates — plan, storage, databases, exposure, tuning — apply as a rolling update in every selected region. Deleting an instance deletes its data.
In this section
- Tiers and replication — single, replicated and highly available, and how to choose.
- Connecting to MySQL — endpoints, credentials and read replicas.
- Databases and users — how the platform manages schemas and users, and what it leaves alone.
- External access — TLS, the allocated port and IP allowlists.
- phpMyAdmin — temporary browser access.
- Backups and point-in-time recovery — dumps, binary logs and the recovery window.
From the blog