Starting, Stopping, and Restarting Instances

This page describes how to start an instance, stop an instance, or restart an instance that is running.

Starting an instance

Start an instance that is stopped to allow connections and operations.

To start an instance:

Console (2nd Gen)

  1. Go to the Cloud SQL Instances page in the Google Cloud Platform Console.

    Go to the Cloud SQL Instances page

  2. Select an instance to start by clicking the instance name.
  3. Click Start, in the button bar at the top of the page.
  4. In the Start database instance? dialog box, click Start.
    The activation policy of the instance is set to Always and the instance is started.

gcloud (2nd Gen)

Start the instance:

gcloud sql instances patch [INSTANCE_NAME] --activation-policy ALWAYS

Console (1st Gen)

  1. Go to the Cloud SQL Instances page in the Google Cloud Platform Console.

    Go to the Cloud SQL Instances page

  2. Select an instance to start by clicking the instance name.
  3. Click Start, in the button bar at the top of the page.
  4. In the Start database instance? dialog box, choose your activation policy and click Start.

    If your First Generation instance is using per-use pricing, you can reduce costs by choosing On Demand. For more information, see Which activation policy should I use? in the FAQ.

gcloud (1st Gen)

Start the instance, choosing either ALWAYS or ON_DEMAND for the activation policy:

gcloud sql instances patch [INSTANCE_NAME] --activation-policy [ACTIVATION_POLICY]

If your First Generation instance is using per-use pricing, you can reduce costs by choosing On Demand. For more information, see Which activation policy should I use? in the FAQ.

To see how the underlying REST API request is constructed for this task, see the APIs Explorer on the instances:patch page.

Stopping an instance

You can manually stop an instance when needed. When you stop an instance, it remains stopped until you start it again.

To stop an instance:

Console

  1. Go to the Cloud SQL Instances page in the Google Cloud Platform Console.

    Go to the Cloud SQL Instances page

  2. Select an instance to restart by clicking the instance name.
  3. Click Stop, in the button bar at the top of the page.
  4. In the Stop database instance? dialog box, click Stop.

    The activation policy of the instance is set to Off (Never) and the instance is stopped.

gcloud

Stop the instance:

gcloud sql instances patch [INSTANCE_NAME] --activation-policy NEVER
To see how the underlying REST API request is constructed for this task, see the APIs Explorer on the instances:patch page.

Restarting an instance

Restarting an instance drains the connections from the instance and stops it. Next, instances with an activation policy of Always restart and are ready to accept new connections. Instances with an activation policy of On Demand remain shut down until there is a new connection request for the instance, at which time the instance is activated and accepts the request.

To restart an instance:

Console

  1. Go to the Cloud SQL Instances page in the Google Cloud Platform Console.

    Go to the Cloud SQL Instances page

  2. Select an instance to restart by clicking the instance name.
  3. Click Restart, in the button bar at the top of the page.
  4. In the Restart database instance dialog box, click Restart.

gcloud

Restart the instance:

gcloud sql instances restart [INSTANCE_NAME]
To see how the underlying REST API request is constructed for this task, see the APIs Explorer on the instances:restart page.

Send feedback about...

Cloud SQL for MySQL