Google Cloud SQL Database

Connecting to Google Cloud SQL database.

Introduction

This tutorial demonstrates how to create and configure a cloud SQL database for your Google Cloud account, as well as how to gain access, which enables you to control and connect it with API Express from Appery.io.

Setting up Google Cloud Database

  1. Open the Google Developers Console.
  2. To create an SQL cloud, click on the View all products on the left menu:
  1. On the list, select Databases > SQL:
  1. Click + CREATE INSTANCE and select the required database engine (MySQL):
  1. In the new window, define the remaining parameters such as: Instance ID, Database version, Region, set the password and then click CREATE INSTANCE:

By default, you will find yourself in the Overview tab:

📘

You can check that the instance is created and saved under your account:

Configuring Google Cloud Database

  1. For creating a new SQL database to be used with API Express from Appery.io, switch to the database Connections > Networking tab:
  1. Click the ADD NETWORK button, define the connection name and set 0.0.0.0/0 for Network:
  1. Then, switch to the Users tab and click + ADD USER ACCOUNT.
    Then, create new user account(s) to access your database:

Configuring Firewall Rules

Please note, that you might need to follow the steps in Exposing Your Database to API Express to configure firewall rules.

Creating API Express Database Connection

  1. Log in to your Appery.io online account.
  2. In the Appery.io App Builder, go to the API Express tab and click Create new DB connection, fill in all the required information, enter its name, and confirm:
  1. In the next window, select *Relational database connection type, then set MySQL as the Database type, and add Host (Public IP address which can be found on the Google Cloud Overview tab – see below for details):
  1. Now, define its Port (3306 – the default MySQL port), Database name (can be found on the Google Cloud Databases tab), and provide the username and password for your MySQL DB (check your Google Cloud account) created earlier.

👍

Click Save

You have now created the Appery.io DB connection. To ensure that the connection from the API Express services to your Google SQL Cloud works, click Test.


Did this page help you?