Configure a MySQL Database Service (MDS) DB System

Configure an MDS DB System

It’s now more than two months since MDS, the managed MySQL Server solution by Oracle MySQL team, hosted on Oracle Cloud Infrastructure (OCI), became available in several regions on the 1st of September. You can find online several resources online, such as:

If you haven’t tried it for free, time to do so with the free trial credit!

You can see how to create your instance, then, with a default configuration (you can follow LeFred’s instructions, for instance). When you create a new instance, a default MDS configuration suiting the compute shape the instance will run on is provided: right now 4 virtual shapes and a bare metal one, from 1 to 64 OCPUs and from 8GB to 512GB: different flavors to run most if not all possible services.

An OCPU provides CPU capacity equivalent of one physical core of a processor with hyper-threading enabled. Each OCPU corresponds to two hardware execution threads, known as vCPUs. Each OCPU has a pre-defined amount of memory.

But if you’d rather start with a customized MDS configuration rather than the default (the default configuration is indeed designed to take the most out of the underlying compute shape characteristics) let’s look at how to configure your brand new instance! You can:

  • Configure it at creation time
  • Configure global configs at runtime
  • Configure sessions at runtime

You cannot access the my.cnf configuration file of a DB System, because configuration is managed via OCI Dashboard, mainly.

Configure at DB System creation time

Before creating the MDS DB System, you can define a custom configuration. Open the panel:

And click the button to create the configuration. Notice that you cannot edit default configuration, listed in this panel.

In the following panel, you will be asked several informations, in particular:

  • The name for this configuration
  • A description
  • And most important, the default template to be used for this new configuration, and here you will indicate the shape this configuration is based on.

Finally, time to choose the customized parameters.

You’re done, now click “Create” and your custom configuration will be created and listed among other ones.

Now you can create your MDS instance using the desired brand new configuration. Go and create the DB system as usual, and select the configuration.

Configure global configs at runtime

Once the DB System is running on a custom configuration, it is not possible to edit the configuration associated. This is reasonable choice: one configuration may be changed for several DB System thus leading to a complex configuration management. It is instead possible to reload a new configuration into the DB System, which can be created as a clone of an existing configuration, be it a default one or a custom one. Proceed as follows.

Clone an existing configuration

Choose a starting configuration, which can be the currently loaded one or a default one. Make sure this parent configuration is for a certain shape: configurations are based on and linked to shapes

Copy an existing MDS configuration

A new panel will open where you’ll be able to choose a name for the configuration and set the desired variables. Once done, save and the configuration will be persisted.

Edit DB System configuration

Once the new configuration is created, you will have to reload it. For that you can use again the dashboard. Browse DB System list and edit the desired DB System candidate to be reconfigured accordingly.

Edit the DB System to be configured

Once in the related panel, choose the right configuration.

Choose the desired new configuration for the DB System

Once done, save and wait until the DB System is restarted.

Alternatively, to reload the configuration, use the update command either from OCI CLI or from the Oracle Cloud Console. You’ll need to indicate both DB System OCID and the configuration OCID, values it’s possible to retrieve from the corresponding instances.

oci mysql db-system update --db-system-id <DB_SYSTEM_OCID> --configuration-id <CONFIG_OCID>

Run this command and the desired configuration will be reloaded for the selected DB System. The DB System will be restarted to make the new configuration effective (make sure you reload the configuration when your service is less impacted).

The whole process is also documented.

Configure sessions at runtime

MDS users can also configure current sessions as usual, using the SET command.

MySQL <DB_SYSTEM_IP>:<DB_SYSTEM_PORT> ssl SQL > SET SESSION join_buffer_size=262144;
Query OK, 0 rows affected (0.0010 sec)

Setting global/ persisted parameters is not permitted, not even for the administrator.

MySQL <DB_SYSTEM_IP>:<DB_SYSTEM_PORT> ssl SQL > SET GLOBAL max_connections=201;
ERROR: 1227 (42000): Access denied; you need (at least one of) the SUPER or SYSTEM_VARIABLES_ADMIN privilege(s) for this operation

MDS is a hosted and managed MySQL Server instance and as such it simplifies its administration to avoid errors and messing up with configuration, while having the opportunity to change relevant parameters with the instructions from previous sections using the dashboard and OCI CLI.

Leave A Comment