This page has procedures for finding and setting maintenance windows for Cloud SQL instances. To learn more about how and why Cloud SQL performs maintenance, see the Overview of maintenance on Cloud SQL instances.
Before you begin
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project. Learn how to check if billing is enabled on a project.
- Install the Google Cloud CLI.
-
To initialize the gcloud CLI, run the following command:
gcloud init
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project. Learn how to check if billing is enabled on a project.
- Install the Google Cloud CLI.
-
To initialize the gcloud CLI, run the following command:
gcloud init
Set a preferred window for maintenance on an instance
Console
-
In the Google Cloud console, go to the Cloud SQL Instances page.
- To open the Overview page of an instance, click the instance name.
- In the Maintenance section, click Edit maintenance preferences.
- In the Configuration options section, open Maintenance.
- Configure the following options:
- Preferred window. Set the day and hour range when updates can occur on this instance.
- Order of update. Set the order for updating this instance, in relation to updates to other instances. Set the timing to Any, Earlier, or Later. Instances using the Earlier setting receive updates up to a week before instances using the Later setting, when comparing instances that reside in the same location.
gcloud
Before using the gcloud command below, make the following replacements:
- instance-id: Instance to reschedule
- day: Day when you want maintenance to occur. Set to one of
SUN
,MON
,TUE
,WED
,THU
,FRI
,SAT
. - hour: Hour of day for maintenance window, in UTC time zone (0-23).
gcloud sql instances patch instance-id \ --maintenance-window-day=day \ --maintenance-window-hour=hourFor reference information, see
gcloud sql instances patch
.