How to Create MySQL Managed Database at DigitalOcean

Managed Database MySQL DigitalOcean

Managed Database is a cloud service that provides a database engine. With a managed database, users no longer need to install and configure databases, including monitoring and maintaining server infrastructure.

Managed database services aim to make users, especially developers, focus on application development, without having to be bothered with managing databases.

DigitalOcean provides managed database services that support 3 database engines, namely MySQL, PostgreSQL, and Redis.

Create a MySQL Managed Database

Creating a managed MySQL database at DigitalOcean is very easy.

  1. Click the menu Create->Databases
  2. Choose a database engine, choose MySQL
  3. Choose a cluster configuration, di sini saya memakai spesifikasi 1GB RAM, 1vCPU, 10GB disk, tanpa Standby Nodeshere I use the specifications of 1GB RAM, 1vCPU, 10GB disk, without Standby Nodes. Standby Nodes are the nodes that become the backup server, if a failure occurs on the main database server, the database service is switched to the standby node (automatic failover)
  4. Choose a datacenter, here I use Singapore
  5. Choose a unique database cluster name, enter a name for the cluster database
  6. Finally, click the button Create a Database Cluster
Create a database cluster
Create a database cluster

Connection to the Database Cluster

After the database cluster is created, then securing the cluster database.

  1. Secure this database cluster, in the field Add trusted sources, enter the name of the droplet, kubernetes cluster, tags, or IP address that is granted access to the database. Here I enter the ubuntu droplet that is in the same region and private network. Then click Allow these inbound sources only
  2. Connection details, displayed connection information to the cluster database, and connections via public and private networks. Click Continue
  3. Next steps, a command is displayed to perform a database migration. Click Great, I’m done
Database cluster overview
Database cluster overview

Create User and Database

Creating a user and database can be done directly in the tab Users & Databases.

Create User

  1. Add new user, enter a new user
  2. Password encryption, choose Default – MySQL 8+ if the MySQL client support MySQL 8 password encryption and select Legacy – MySQL 5.x otherwise
  3. Password is provided automatically

Create Database

  • Add new database, enter a new database name

Connect to Database

Previously the database cluster was set up so that it could only be accessed by the ubuntu droplet, therefore database access tests were run on that droplet.

Connect to database using the MySQL client, install the MySQL client on Ubuntu.

Copy the command to connect to the database (flags) shown in the connection details.

Database connection details
Database connection details

Testing database access via the public network.

MySQL connection status via public network
MySQL connection status via public network

Testing database access via private network.

MySQL connection status via private network
MySQL connection status via private network

Show all databases.

The result.

Get a $100 free credit for every new account creation at DigitalOcean, register via this link

Good luck 🙂

Default image
Musa Amin
I am a Linux System Administrator and also write many tutorials about Linux, Cloud, and Open Source. Hire me via email hai[at]musaamin.web.id.
Articles: 712

Leave a Reply