Hide
Google Cloud SQL

Creating Instances

A Google Cloud SQL instance is a MySQL database hosted in Google's cloud. To create an instance, you must be a project team owner or editor. If this is not the case, ask a current owner on the project team to add you to the team by following the instructions in Adding a Project Member.

To create an instance:

Developers Console

  1. Go to the Google Developers Console.
  2. Create a new Developers Console project, or open an existing project by clicking on the project name.
  3. In the sidebar on the left, click Storage > Cloud SQL to show a list of Cloud SQL instances for the project.
  4. Click New Instance to create a new Cloud SQL instance in your project.
  5. Enter a name for the instance.

    An instance name must meet the following criteria:

    • Be unique within the project.
    • Contain between 1 and 99 lowercase letters, hyphens, or numbers.

      If you plan on using this instance for replication, the instance's full name (including project name, colon, and instance name) must be equal to or less than 39 characters in length.

    • Start with a lowercase letter.

    The instance name you specify is automatically combined with your project name, and any domain-specific names as shown here:

    • Non-domain: your-project-name:your-instance-name
    • Domain-specific: your-domain:your-project-name:your-instance-name
  6. Optionally, continue to configure the instance. Or, to accept the default values for the instance settings, skip this step.
  7. Click Save to create the instance.

    It may take several moments before the instance is ready to use. The Status field on the instance summary page displays "Runnable" when your instance is ready to use.

Cloud SDK

  1. Install the Cloud SQL command line if you haven't already (see Managing Instances Using the Cloud SDK).
  2. Set the project to the one where you want to create the instance.
    $ gcloud config set project YOUR_PROJECT_ID
    
  3. Create the instance.

    The simplest create command specifies only the instance name.

    $ gcloud sql instances create YOUR_INSTANCE_NAME
    

    If you plan on using this instance for replication, the instance name must be 39 characters or less in length.

    Here is an example of create command that specifies tier, region, and pricing plan.

    $ gcloud sql instances create YOUR_INSTANCE_NAME \
      --tier TIER \
      --region REGION \
      --pricing-plan PRICING_PLAN
    

    For details about all the options you can specify in the instances create command, run gcloud sql instances create --help or see the instances create command in the Cloud SDK documentation.

  4. You can check that the instance was created by using the instances describe command.
    $ gcloud sql instances describe YOUR_INSTANCE_NAME
    

After you create an instance, you can start using it. Here are several common next steps for using your Google Cloud SQL instance: