Adding an Instance for Google Cloud SQL for MySQL

To manage a database, you can either use an existing instance or add a new instance.

Before You Begin

  • To discover database instances, enable the Cloud SQL Admin and Cloud Resource Manager APIs in the project where service account is hosted.

  • Your Google account must contain the following permissions to access the Google resources:

    Role

    Title

    Description

    Permissions

    Lowest Resource

    roles/cloudsql.viewer

    Cloud SQL Viewer

    Provides read-only access of Cloud SQL resource.

    cloudsql.backupRuns.get

    cloudsql.backupRuns.list

    cloudsql.databases.get

    cloudsql.databases.list

    cloudsql.instances.export

    cloudsql.instances.get

    cloudsql.instances.list

    cloudsql.instances.listServerCas

    cloudsql.sslCerts.get

    cloudsql.sslCerts.list

    cloudsql.users.list

    resourcemanager.projects.get

    resourcemanager.projects.list

    serviceusage.quotas.get

    serviceusage.services.get

    serviceusage.services.list

    Project

Procedure

  1. From the navigation pane, go to Protect > Databases.

    The Databases page appears.

  2. Click Add instance, and then select Cloud database service.

    The Add Cloud DB instance page appears.

  3. From the Vendor list, select Google Cloud Platform, and then click Next.

    The Configure Google Cloud Database page appears.

  4. From the Select A Database Service list, select MySQL and then click Next.

    The Configure Google Cloud Database - MySQL page appears.

  5. In the Plan section, select a backup plan to use for the instance, and then click Next.

    The Cloud Account page appears.

  6. From the Cloud account list, select an existing cloud account or add a new cloud account.

  7. To add a new cloud account, beside the Cloud account list, click +.

    The Add cloud account appears.

  8. In the Name box, type the name for the account.

  9. From the Credential list, select an existing credential or add a new credential.

    Steps to add a new credential
    1. Click the + icon beside the Credentials list.

      The Add Credential dialog box appears.

    2. From the Credential Vault list, select a credential vault to store credentials for different types of accounts.

    3. In the Credential name box, enter a name for the credential.

    4. Beside Private key file field, click Upload to choose your JSON key file.

    5. In the Description box, enter the details of the credential.

    6. Click Save.

  10. From the Access node list, select an existing credential or add a new access node.

    Steps to add a new access node
    1. Click the + icon beside the Access node list.

      The Add a new Access node dialog box appears.

    2. Select Deploy a new access node button.

    3. From the Platform list, you can select the following two platforms:

      • Windows

      • Linux

    4. In the Instance name list, enter the name of the access node.

    5. In the Project id box, enter the project id.

    6. In the Subnet URL, enter the subnet url or path.

    7. Beside Private key file field, click Upload to choose your JSON key file.

    8. In the VPC Network URL box, enter the url or path of the network.

    9. Click Close.

  11. Click Save.

  12. Click Next.

    The Cloud database instance details page appears.

  13. From the Instance name list, select an instance.

  14. Under the Connection details section, enter the following details:

    1. From the Credential list, select a saved credential or add a new credential.
    Steps to add a new credential
    1. Click the + icon beside the Credentials list.

      The Add Credential dialog box appears.

    2. From Account type list, select a database account.

    3. From the Database type, select a database.

    4. From the Credential Vault list, select a credential vault to store credentials for different types of accounts.

    5. In the Credential name box, enter a name for the credential.

    6. If you do not move the Use GCP service account toggle key to right, do the following:

      • In the Username box, enter the user name to access the Google Cloud Database SQL for MySQL application.

      • In the Password box, enter the password to access the Google Cloud Database SQL for MySQL application.

      Note

      If you move the Use GCP service account toggle key to right, you do not need to enter the credential details.

    7. The SSL certificate toggle key is unselected by default. By moving the toggle key to right, you can perform the following actions:

      • In the SSL CA file field, provide the SSL CA file path on the proxy computer.

      • In the SSL Cert file field, provide the SSL certificate file path on the proxy computer.

      • In the SSL Key file field, provide the SSL key file path on the proxy computer.

    8. In the Description box, enter the details of the credential.

    9. Click Save.

  15. In the Endpoint box, type the name of the endpoint to connect to the database instance.

  16. Click Next.

    The Backup Content page appears.

  17. Click Next.

  18. To filter the content that is backed up, click Edit, select or clear the tables, and then click Save.

    The Summary page appears.

  19. Review the summary, and then click Finish.

Results

The new instance contains a default database group. The default database group includes all the data in the Google Cloud SQL for MySQL database. You cannot delete the default database group.

×

Loading...