Skip to main content
MySQL is an open-source relational database management system (RDBMS) that’s popular for its performance, ease of use, and extensive ecosystem. This guide walks you through running MySQL on an Archil disk. MySQL doesn’t need to know anything about Archil or S3 — it just reads and writes files to its data directory as usual. By pointing that data directory at an Archil mount, you get:
  • Elastic storage: no need to provision or resize disks as your database grows
  • S3 durability: all data is automatically synchronized to S3 in the background
  • Pay for what you use: you’re only billed for active data, not provisioned capacity
  • Portability: unmount from one server and mount on another to move your database

Create an Archil disk

First, follow the Archil Getting Started Guide to create an Archil disk.

Install MySQL

The exact instructions for installing MySQL will vary depending on your operating system. For example, on Amazon Linux 2023, you can install MySQL with the following commands:
Mount your Archil disk to an easy to access directory.
Set the MySQL data directory to the Archil disk. Open the file /etc/my.cnf in your favorite editor. Under the [mysqld] section, identify the line that starts with datadir= and edit the path to look like the following:
Initialize the MySQL database in your data directory, and start the MySQL service.
Note the temporary password that was generated for the root user by looking through the initialization log.
Change your root password to something more secure.
By default, the MySQL password policy requires that you set a password of at least 8 characters that contains at least one uppercase letter, one lowercase letter, one number, and one special character.
Validate that MySQL is running on Archil by executing the following command, logging in with your new password.
This should output the data directory you previously set up, /mnt/archil/mysql.

(Optional) Run a benchmark to validate performance

First, download and compile the sysbench tool.
Create a database and write test data to it.
Finally, run the test: