Creating a DB System

This topic describes how to create and configure a MySQL DB System. The following topics are described:

Creating a MySQL DB System

This topic describes how to launch a new DB System.

  1. Open the navigation menu. Under MySQL, click DB Systems.
  2. Click Create MySQL DB System.
  3. On the Create MySQL DB System dialog, provide the DB System details:
    • Select a Compartment: If you want to launch the MySQL DB System in a compartment other than the current compartment, select the required Compartment from the list. If you do not select a different compartment, the current compartment is used.
    • Name your DB System: A user-friendly display name for the DB system. The name does not need to be unique. An Oracle Cloud Identifier (OCID) uniquely identifies the DB system.
    • Description: A user-friendly description of the DB System and its purpose.
    • Select an Availability Domain: The availability domain in which the DB system resides.
    • Select a Fault Domain: A fault domain is a grouping of hardware and infrastructure within an availability domain. Each availability domain contains three fault domains. Fault domains let you distribute your DB Systems so that they are not on the same physical hardware within a single availability domain.
    • Select a Configuration: Opens the Browse All Configurations dialog. Select the configuration to use for your DB system. The shape determines the resources allocated to the system. For more information on the available shapes, see Supported Shapes. You can filter the MySQL Configurations displayed by selecting one of the labels from Configuration Type and one of the labels from Shape Type. Click Select a Configuration after you have selected the shape and configuration required.
    • Data Storage Size: The amount of block storage, in GB, to allocate to the DB System.
    • Maintenance Window Start Time (Optional): specify a convenient time for required maintenance. If you do not specify a day and time, one is chosen for you.
    • Advanced Options: Optionally, you can apply tags. For more information on tagging, see Resource Tags.
  4. Click Next to display the Database Information page.
  5. Create Administrator credentials: Specify the database administrator's credentials
    • Username: the user name of the Administrator user. See Reserved Usernames for more information.
    • Password: the Administrator user's password.
    • Confirm Password: re-enter the Administrator user's password.
  6. Specify the network information:
    • Virtual Cloud Network: the VCN in which to launch the DB System.
    • Subnet: select the required subnet of the selected VCN.
    • Hostname: Your choice of host name for the DB system. The host name must begin with an alphabetic character, can contain only alphanumeric characters and hyphens (-), and must not use more than 30 characters. The hostname must be unique within the subnet. If it is not unique, the DB System will fail to provision.
    • MySQL Port: the port on which the server listens.
    • MySQL X Protocol Port: supported by clients such as MySQL Shell.
  7. Click Next to open the Backup Information page.
  8. Specify the backup details:
    • Enable Automatic Backups: Select to enable scheduled backups. If you do not specify scheduled backups, you must manage your backup strategy manually. It is strongly recommended to enable scheduled backups.
    • Retention Period: Defines how long to retain the backups, in days. Default is seven days.
    • Backup Window: A backup window is defined as a time during which the backup is initiated.
    • Click Show More to see the list of per-Region time windows.
    • To specify a custom backup window, select Select Backup Window. The Backup Window Start Time field is displayed. Specify your backup window start time. Your backup begins processing in the 30 minutes following the defined start time.
  9. Click Create to create the DB System.
    The MySQL DB System is created.

Creating a DB System using the CLI

This task describes how to create a DB System using the CLI mysql db-system create command. It creates a DB System with Backups enabled.

To perform this task, you must have the following:
  • Compartment OCID
  • Policy which permits you to create DB Systems in the compartment or tenancy.
  • Properly configured OCI CLI installation and the requisite SSH keys.
  • Properly configured VCN. See Configuring the Network for more information.
This task shows the command line syntax and parameters used to create a DB System using a JSON payload.
  1. Open a command prompt and run the following to create a DB System. For example:.
    oci mysql db-system create --from-json file://dbsystem-launch.json

    where dbsystem-launch.json contains the following:

    {
      "adminUsername": "User001",
      "adminPassword": "User001@#",
      "compartmentId": "ocid1.compartment.oc1..longAlphaNumericString", 
      "configurationId": "ocid1.mysqlconfiguration.oc1..longAlphaNumericString", 
      "shapeName": "VM.Standard.E2.1", 
      "dataStorageSizeInGbs": 63, 
      "description": "This is my DBSystem", 
      "displayName": "MyDBSystem", 
      "hostname": "MyHostname",
      "availabilityDomain": "LqKe:US-ASHBURN-AD-3",
      "subnetId": "ocid1.subnet.oc1.iad.longAlphaNumericString",
      "backupPolicy": {
        "isEnabled": true,
        "retentionInDays": 7,
        "windowStartTime": "00:10"
      }
    }

    where:

    • adminUsername: (mandatory) the user name of the root user of the DB System. Some usernames are reserved and cannot be used in the definition of a DB System. For more information, see Reserved Usernames.

    • adminPassword: (mandatory) the password of the root user of the DB System.

    • compartmentId: (mandatory) the OCID of the compartment in which the DB System is created.

    • availabilityDomain: (mandatory) the name of the availability domain in which theDB System is created.

    • configurationID: (mandatory) the OCID of the configuration to apply to the DB System.

    • shapeName: (mandatory) the name of the shape.

    • subnetId: (mandatory) the OCID of the VCN subnet the DB System is attached to.

    • dataStorageSizeInGbs: (mandatory) the amount of data storage, in GBs, for theDB System.

      Note

      Do not specify a value less than 50, or greater than 32768.
    • hostname: The host name for the DB System. The host name must begin with an alphabetic character and can contain a maximum of 30 alphanumeric characters, including hyphens (-). The maximum length of the combined hostname and domain is 63 characters. If you do not assign a hostname, no default value is provided.

      Note

      The hostname must be unique within the subnet. If it is not unique, the DB system will fail to provision.

      The hostname provided is used to create an address in the following format: hostname.subnetid.VCNName.oraclevcn.com. For example: MyHostname.sub04222208371.MyVcnname.oraclevcn.com.

    • description: a brief, user-defined description of the DB System.

    • displayName: the display name of the DB System. If you do not define a display name, one is generated for you. Generated names take the form mysqldbsystemYYYYMMDDHHMMSS.

    • backupPolicy: the container for the backup policy parameters. The following parameters define the schedule for automatic backups of your DB System:
      • isEnabled: set to true to enable backups.
      • retentionInDays: number of days to retain the automatic backups. The default is 7.
      • windowStartTime: specifies the start of a 30-minute window in which daily, automated backups are performed. Uses the following format: HH:MM in UTC. You can also define offsets, for example: 00:00-08:00, which sets the time to 8 hours behind midnight UTC.
    If the command validates and is processed correctly, a response similar to the following is displayed, summarizing the request made:
    {
      "data": {
        "availability-domain": "fblN:US-ASHBURN-AD-3",
        "backup-policy": {
          "defined-tags": null,
          "freeform-tags": null,
          "is-enabled": true,
          "retention-in-days": 7,
          "window-start-time": "00:10"
        },
        "compartment-id": "ocid1.compartment.oc1..longAlphaNumericString",
        "configuration-id": "ocid1.mysqlconfiguration.oc1..longAlphaNumericString",
        "data-storage-size-in-gbs": 63,
        "defined-tags": {
          "Oracle-Tags": {
            "CreatedBy": "userName",
            "CreatedOn": "2020-06-22T16:15:04.315Z"
          }
        },
        "description": "This is my DBSystem",
        "display-name": "MyDBSystem",
        "endpoints": [],
        "fault-domain": null,
        "freeform-tags": {},
        "hostname-label": null,
        "id": "ocid1.mysqldbsystem.oc1.iad.longAlphaNumericString",
        "ip-address": null,
        "lifecycle-details": null,
        "lifecycle-state": "CREATING",
        "maintenance": {
          "window-start-time": "SUNDAY 11:16"
        },
        "mysql-version": null,
        "port": null,
        "port-x": null,
        "shape-name": "VM.Standard.E2.1",
        "source": null,
        "subnet-id": "ocid1.subnet.oc1.iad.longAlphaNumericString",
        "time-created": "2020-06-22T16:15:05.809000+00:00",
        "time-updated": "2020-06-22T16:15:05.809000+00:00"
      }
    } 
The MySQL DB System, MyDBSystem, is created.

It is also possible to run the command from a single command line, rather than using a JSON payload. The following command is identical to that in the JSON payload:

 oci mysql db-system create -c ocid1.compartment.oc1..longAlphaNumericString 
 --configuration-id ocid1.mysqlconfiguration.oc1..longAlphaNumericString   
 --shape-name VM.Standard.E2.1 --availability-domain fblN:US-ASHBURN-AD-3 
 --subnet-id ocid1.subnet.oc1.longAlphaNumericString 
 --admin-username User001 --admin-password User001# --data-storage-size-in-gbs 63 
 --display-name MyDBSystem --description "This is my DBSystem" --hostname-label MyHostname 
 --backup-policy '{ "isEnabled": true, "retentionInDays": 7, "windowStartTime": "00:10" }'
       

Reserved Usernames

The following usernames are reserved and cannot be used for the Administrator's username:

  • ociadmin
  • ocirpl
  • administrator
  • mysql.sys
  • mysql.session
  • mysql.infoschema
  • ocimonitor