Setting Up a DigitalOcean Managed MySQL Database and Adding It to SpinupWP

This guide will help you set up a DigitalOcean managed MySQL database for use with new servers set up by SpinupWP. By the end of this tutorial, you will have the database hostname, port, username, password, and database name you need to configure the managed MySQL database as an external database in SpinupWP.

We also have a doc for setting up a managed database server on Amazon Lightsail.

This article covers the following steps:

Creating a New DigitalOcean Managed MySQL Database

To create a new DigitalOcean database, log into your DigitalOcean account and click the Create button at the top of the DigitalOcean dashboard.

DigitalOcean Databases.

Select Databases from the list of available products to create.

Create new DigitalOcean Database.

This will open the “Create a database cluster” page. Your first step is to choose a database engine. As WordPress only works with MySQL, select it from the available options.

Under “Choose a cluster configuration” you have three “Machine Types” to choose from. “General Purpose nodes” give you dedicated CPUs, so if you know that your database is going to require a lot of CPU, it might make sense to choose this option. Similarly, if your database takes a lot of disk space, “Storage-Optimized nodes” may interest you. “Basic nodes” will work just fine in the majority of situations.

Once you choose the machine type, you’ll need to select a “Node Plan” based on your CPU, memory, and disk space requirements. You can easily upgrade later without downtime, but you cannot easily downgrade.

“Standby Nodes” are essentially read-to-go backup servers that can keep your database operational should your main database server go down for some reason. It’s not something we have used ourselves and feel as though it is a bit overkill for most applications.

DigitalOcean database engine selection.

Next, you will need to choose a datacenter. Make sure to choose the same datacenter where your web server instance is located. This will ensure that latency between your web server and external database is kept to a minimum.

DigitalOcean datacenter selection

Choosing the same datacenter as your web server allows the use of a VPC Network automatically. All resources created in this datacenter will be members of the same VPC network which means they can communicate securely over private IP addresses.

Your last step is to give your database a unique name. We typically use the domain name of the server for our server names, but you can use whatever you like. If you have more than one project set up in your DigitalOcean account, you can also select the project the database should belong to. A default database (defaultdb) and admin user (doadmin) will automatically be created.

DigitalOcean finalize database cluster.

Once you are ready, click the Create a Database Cluster button. It takes a few minutes for the database to be set up. While the database is being created, you can set up a secure connection to it.

Only Allow Connections From Your DigitalOcean Instance

If this is the first time you are adding a database to the default VPC network, you’ll be presented with the “Getting Started” wizard. Click on the Get Started button.

DigitalOcean new database cluster wizard

In order to secure your database, you need to add at least one trusted source. This will allow connections only from your trusted source(s) and restrict all other incoming connections. You can search from the list of available servers in the “Add trusted sources” list to add the web server(s) that should be able to connect to this database. Try to limit this only to the specific web servers that need access to the database. You can always add more trusted sources at a later stage. Once you have added at least one trusted source, click the Allow these inbound sources only button.

DigitalOcean restrict inbound connections

The database server will be secured, and the wizard will present you with the details to connect to the database. The default connection details will be that of the public network.

DigitalOcean database cluster connections.

Click on the VPC network tab to view the connection details in the VPC network. Using these details means that if your database credentials are ever leaked, no one can connect to the database unless they also have access to your web server. These are the connection details you should use to add this database server as an external database in SpinupWP.

DigitalOcean database cluster VPC connections.

Take note of the username, password (you’ll need to click show to get this), host, and port. These are all the bits of info you’ll need when adding this database server as an external database in SpinupWP. Click Continue to move to the next step.
The final step of the wizard presents you with the next possible steps, such as importing your data, configuring automatic updates, and database backup settings. The defaults will suffice for now. Click Great, I’m done to complete the wizard.

DigitalOcean database cluster next steps.

You’ll be presented with the database cluster overview. The database server might still be in the process of being created, which you can see by the blue progress bar, and the “CREATING” status next to the database server name.

DigitalOcean database cluster overview.

Once the database server creation has completed you can use the username, password, host, and port to add the database server as an external database to SpinupWP. Remember, be sure to use the “VPC network” connection parameters and not the “Public network” connection parameters.

Start Your 7-Day Free Trial

Start your SpinupWP journey today and spin up your first server within minutes.

Subscribe to get the latest news, updates and optimizations in performance and security.

Thanks for subscribing 👍

To receive awesome stuff, you'll need to head to your inbox and click on the verification link we sent you.
Make sure to check your "spam" folder or your "promotions" tab (if you have Gmail).
If you're still having trouble, then message us at sudo@spinupwp.com.

You are already logged in

It looks like you are already logged in to SpinupWP.

Please log out of this account to continue.

Registration Successful

Thanks for registering for a new
SpinupWP account.

Before getting started, could you verify your email address by clicking on the link we just emailed to you?

SpinupWP

Free Trial

Start Your 7-Day Free Trial

No credit card required. All features included.

By signing up to SpinupWP, you agree to our Terms and Conditions.
For privacy related information, view our Privacy Policy.