Restarting an instance drains the connections from an instance and stops the instance. On-demand instances remain shut down until there is a new connection request for the instance, at which time Google Cloud SQL spins up the instance to service the request.
You should rarely need to restart an instance.
To restart an instance:
Developers Console
- Go to the Google Developers Console and select a project by clicking on the project name.
- In the sidebar on the left, click Storage > Cloud SQL to show a list of Cloud SQL instances for the project.
- Select an instance to restart by clicking the instance name.
- Click Restart.
- In the Restart database instance dialog box, click OK.
Cloud SDK
- If needed, set the project to the one that contains the instance to
restart.
$ gcloud config set project YOUR_PROJECT_ID
- Restart the instance.
$ gcloud sql instances restart YOUR_INSTANCE_NAME
- You can check that the instance is running by returning the instance
state. For Linux/Mac OS X, you can use:
$ gcloud sql instances describe YOUR_INSTANCE_NAME | grep state
For Windows, you can use:
$ gcloud sql instances describe YOUR_INSTANCE_NAME | findstr state