DigitalOcean’s Managed Databases for MySQL let you run a production-ready MySQL instance without the headache of manual setup and maintenance.

Let’s get one up and running.

First, navigate to the "Databases" section in your DigitalOcean control panel. Click "Create Database Cluster."

You’ll see a few options. For MySQL, select "MySQL."

Next, choose your plan. The smallest, $15/month, is fine for getting started and testing. It gives you 1 vCPU, 1GB RAM, and 10GB of SSD storage, with 25GB of outbound data transfer. This is plenty for development or small applications.

Choose a datacenter region that’s geographically close to your application’s users or your other DigitalOcean resources. This minimizes latency.

Give your database cluster a name. Something like my-app-mysql-prod is descriptive.

Hit "Create Database Cluster."

Provisioning takes a few minutes. Once it’s ready, you’ll see its status as "Active."

Click on the cluster name. The overview page is your central hub. You’ll see connection details here. Crucially, there’s a "Connection Details" section. It shows your host, port (3306 for MySQL), username (defaults to doadmin), and password. Generate a new password here and store it securely. This is the superuser for your database.

You’ll also see options to add read-only nodes for scaling read traffic. For now, we’ll stick with the single primary node.

Under the "Databases" tab, you can create your first database. Click "Create Database." Name it something like app_db.

Now, how do you connect? You can use a standard MySQL client like mysql from your terminal, or a GUI tool like TablePlus or DBeaver.

From your terminal, assuming you have the mysql client installed:

mysql -h your_database_host.digitalocean.com -u doadmin -p -P 3306 app_db

Replace your_database_host.digitalocean.com with the actual host from your connection details. You’ll be prompted for the password you generated.

Once connected, you’ll see the mysql> prompt. You can now run standard SQL commands:

SHOW TABLES;
CREATE TABLE users (
    id INT AUTO_INCREMENT PRIMARY KEY,
    username VARCHAR(50) NOT NULL,
    email VARCHAR(100) UNIQUE NOT NULL
);
INSERT INTO users (username, email) VALUES ('alice', 'alice@example.com');
SELECT * FROM users;

The most surprising thing about managed databases is how little they actively require your attention for routine operations, yet how much control you still have over the underlying configuration and performance. For example, while DigitalOcean handles patching and backups, you can still tune the innodb_buffer_pool_size or max_connections directly from the "Settings" tab of your database cluster. This offers a blend of convenience and granular control that traditional self-hosted setups often lack without significant operational overhead.

The primary lever you’ll pull for performance tuning, beyond the hardware plan, is adjusting the MySQL configuration variables accessible via the "Settings" tab. Common adjustments include innodb_buffer_pool_size to control how much data is cached in memory, and max_connections to manage how many simultaneous client connections your database can handle. Be cautious: setting these too high can lead to instability or excessive memory usage.

The next step is setting up read replicas to distribute read load and improve application performance.

Want structured learning?

Take the full Digitalocean course →