Validated on 29 Sep 2023 • Last edited on 18 Dec 2024
MySQL is an open source, object-relational database built with speed and reliability in mind. Its large and active developer community has created many third-party applications, tools, and libraries that expand MySQL’s functionality.
You can resize existing MySQL database clusters at any time to add more CPUs, RAM, and storage. To avoid data loss, you cannot decrease the size of database clusters.
Resize a Database Cluster Using the CLI
Note
To resize a database cluster using doctl, you need to provide a value for the --size flag, which specifies the cluster’s new configuration (number of CPUs, amount of RAM, and hard disk space). Use the doctl databases options slugs command to get a list of available values.
You can also review a list of available slugs for each engine on its pricing page.
How to Resize a Database Cluster Using the DigitalOcean CLI
To resize a database cluster using the API, you need to provide a value for the size field, which specifies the cluster’s configuration (number of CPUs, amount of RAM, and hard disk space). Use the /v2/databases/options endpoint to get a list of available values.
You can also review a list of available slugs for each engine on its pricing page.
How to Resize a Database Cluster Using the DigitalOcean API
To resize a MySQL database cluster, click the name of the cluster in the control panel to go to its Overview page, then click the Settings tab.
Warning
You cannot reduce the amount of added storage in a cluster lower than the amount of storage you are currently using in your cluster. If you need to downscale, you can instead fork the cluster and select a smaller storage size for the new cluster.
In the Cluster configuration section, click Edit. Select your cluster configuration and CPU option.
Then, select your storage size.
Once you have selected your new configuration and size, click Save to provision the new configuration. The provisioning takes several minutes but the total time depends on the size of the cluster.
Your cluster’s state changes from Active to Resizing until the process is done. You can expect no downtime and do not need to take action.