Skip to main content
Open console

MySQL 8

Oracle's MySQL, for applications and teams committed to it rather than to MariaDB

2 min read

Oracle's MySQL rather than MariaDB. It has the same wire protocol and the same driver, so an application does not know the difference unless it is asking for something only one of them has.

Choose it where an application or a team is committed to MySQL itself: a feature that only exists there, a tool that refuses to run against anything else, or an operations team who know its behaviour under load. Otherwise use MariaDB, the default.

Like every database here it stays on the machine's own disk. See Storage for what can be moved onto a disk of its own.

From your own computer — a desktop client, a browser — vallic tunnel <env> db opens it on 127.0.0.1:3306. See Tunnels.

Versions

Version Status
8.0 Supported, and the default
8.4 Supported

Pin the version, not the build: name 8.0 and the platform matches it to the current build, so a security rebuild reaches you without anybody editing a repository.

The version you name is the one your environment runs from the next deploy. This service keeps data, and not every version can read another's — before you change it, read Changing a service's version.

What you can change

In vallic.yaml — what each one does is on Service settings:

services:
  - mysql:
      version: '8.0'
      environment:
        MYSQL_MAX_ALLOWED_PACKET: …
        MYSQL_INNODB_BUFFER_POOL_SIZE: …
        MYSQL_MAX_CONNECTIONS: …
        MYSQL_SLOW_QUERY_LOG: …
        MYSQL_LONG_QUERY_TIME: …

Anything not on this list refuses the deploy, naming the variable — rather than being accepted and quietly ignored.

Versions

8.0 and 8.4. 8.0 is what a stack gets unless it names another, and it has had its last release; 8.4 is MySQL's long-term line.

The database's files cannot go back to 8.0 once 8.4 has started on them. Try the move on a preview environment first, and take a backup of production before it moves.

To move, name 8.4 under services in vallic.yaml:

services:
  - mysql: '8.4'

On the next deploy MySQL upgrades the database's files in place, the first time 8.4 starts on them.

Connecting to it

Read the environment rather than committing credentials. The same names as every other database:

DB_HOST      the service name
DB_PORT      3306
DB_DRIVER    mysql
DB_NAME
DB_USER
DB_PASSWORD

See Variables for the full list and settings.vallic.php for a Drupal site, which reads all of it for you.

Backups

Dumped nightly with everything else, and restored the same way. The backup schedule is the same as MariaDB's — see Backups.

Next

  • Storage — why the database is not offered a disk of its own
  • MariaDB — the default, and what you get if you say nothing
Need a hand?

Open a ticket from Support in the console. We answer on the ticket.

Open the console How support works