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:
550
  1. On the list, select Databases > SQL:
1253
  1. Click + CREATE INSTANCE and select the required database engine (MySQL):
1434
  1. In the new window, define the remaining parameters such as: Instance ID, Database version, Region, set the password and then click CREATE INSTANCE:
441

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

1539

📘

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

1592

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:
819
  1. Click the ADD NETWORK button, define the connection name and set 0.0.0.0/0 for Network:
721
  1. Then, switch to the Users tab and click + ADD USER ACCOUNT.
    Then, create new user account(s) to access your database:
727

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:
847
  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):
900
  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.

658