After you create an instance, you can edit the instance at any time to change its settings. For example, you might want to change the backup window or the billing plan of the instance as your application needs change. For all instance settings except instance size (tier), Google Cloud SQL applies the change immediately. For changes to the instance size, Google Cloud SQL automatically starts and stops the instance for a few moments to make the change. During this time, applications will not be able to connect to the instance. This is typically not a problem for applications designed to deal with temporary disruptions to database connectivity.
To edit general instance settings:
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 edit by clicking the instance name.
- Click Edit.
- Make your changes to the instance settings.
You can configure:- Tiers and billing plans, see Packages Billing Plan.
- Preferred location, which can be either a Google Compute Engine zone or a Google App Engine application. When you choose a location, Google guarantees low latency between the location and your Cloud SQL instance.
- Backups and point-in-time recovery, see Backups and Recovery.
- Replication modes, see the FAQ.
- Access to your instance, see Configuring Application Access Control.
- Custom MySQL flags for your instance, see Setting MySQL Flags.
- Click Save to apply the changes.
Cloud SDK
- Install the Cloud SQL command line if you haven't already (see Managing Instances Using the Cloud SDK).
- Set the project to the one that contains the instance to edit.
$ gcloud config set project YOUR_PROJECT_ID
- Use the
instances patchcommand and specify the flags for the settings you want to edit.For example, the following command modifies the backup start time, the pricing plan, and the tier.
$ gcloud sql instances patch YOUR_INSTANCE_NAME \ --backup-start-time 16:00 --pricing-plan PACKAGE --tier D2
If the patch modifies a value that requires your instance to be restarted, you will be prompted to proceed with the change or cancel.
For details about all the options you can specify in the
instances patchcommand, rungcloud sql instances patch --helpor see theinstances patchcommand in the Cloud SDK documentation.
To edit access control settings:
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 edit by clicking the instance name.
- Select the Access Control tab.
- Make your changes to the access control settings.
From this panel, you can:- Add or remove an IPv4 address assigned to the instance.
- Add or remove authorized networks from which external applications can connect. For more information, see Configuring access control for IP connections.
- Add or remove an authorized App Engine application ID. For more information, see Configuring access control for App Engine applications
Cloud SDK
- If needed, set the project to the one that contains the instance to edit.
$ gcloud config set project YOUR_PROJECT_ID
- Use the
instances patchcommand and specify the flags for the access control settings you want to edit.Access control setting include instance IPv4 address, authorized networks, authorized App Engine applications, and SSL configuration. For example, the following command assigns an IP address and authorizes the specified IP address range.
$ gcloud sql instances patch YOUR_INSTANCE_NAME \ --assign-ip --authorized-networks 192.168.100.0/24
For details about all the options you can specify in the
instances patchcommand, rungcloud sql instances patch --helpor see theinstances patchcommand in the Cloud SDK documentation.