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
- Open the Google Developers Console.
- To create an SQL cloud, click on the View all products on the left menu:
![03-23 13.07..png 550](https://files.readme.io/f3f9dfa-03-23_13.07..png)
- On the list, select Databases > SQL:
![03-23 13.06..png 1253](https://files.readme.io/c5824ec-03-23_13.06..png)
- Click + CREATE INSTANCE and select the required database engine (MySQL):
![03-23 13.12..png 1434](https://files.readme.io/1c4c104-03-23_13.12..png)
- In the new window, define the remaining parameters such as: Instance ID, Database version, Region, set the password and then click CREATE INSTANCE:
![03-23 13.16..png 441](https://files.readme.io/2d79494-03-23_13.16..png)
By default, you will find yourself in the Overview tab:
![03-23 13.36..png 1539](https://files.readme.io/87536d4-03-23_13.36..png)
You can check that the instance is created and saved under your account:
![03-23 13.20..png 1592](https://files.readme.io/0665068-03-23_13.20..png)
Configuring Google Cloud Database
- For creating a new SQL database to be used with API Express from Appery.io, switch to the database Connections > Networking tab:
![03-23 13.37..png 819](https://files.readme.io/de3ba3a-03-23_13.37..png)
- Click the ADD NETWORK button, define the connection name and set 0.0.0.0/0 for Network:
![03-23 13.41..png 721](https://files.readme.io/350f510-03-23_13.41..png)
- Then, switch to the Users tab and click + ADD USER ACCOUNT.
Then, create new user account(s) to access your database:
![03-23 13.42..png 727](https://files.readme.io/da4f507-03-23_13.42..png)
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
- Log in to your Appery.io online account.
- 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:
![03-23 14.09..png 847](https://files.readme.io/bdd6e04-03-23_14.09..png)
- 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):
![03-23 13.51..png 900](https://files.readme.io/901ea9b-03-23_13.51..png)
- 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.
![03-23 14.04..png 658](https://files.readme.io/0e2594d-03-23_14.04..png)
Updated about 1 month ago