This tutorial shows you 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.
- Open the Google Developers Console
- To create an SQL cloud click on the Products & services menu on the left where it states Google Developers Console.
- In the pop-up list select Storage > SQL and click Create Instance.
- Now select the required generation.
- Define the remaining parameters such as: Instance ID, Region and Tier, then click Create.
- By default, you are in the Overview tab, but there are also Database, Access Control, Replicas and Operations tabs.
- To create a new SQL database to be used with Appery.io API Express, open the Databases tab and click New database.
- Enter the database name and click Add.
- Now, you can configure Access Control to your instance with the database. To do this, switch to the Access Control tab.
- In the new window, select the IP address option and click Request IPv4 address to be able to use it with the API Express services.
- Then, switch to the Users tab and click Create user account.
- Create new user accounts to access your database with hosts restriction, and add access for these hosts using their actual IP addresses
To find out your current IP address for nodes please go back to Working with an Microsoft Azure Account in this document.
- Now, go to the Authorization tab and add an authorized network under the corresponding panel by clicking on + Add item.
- Provide access for all nodes described above using the actual IP addresses.
- Add the authorized networks and click Save.
You can find information on how to grant access to an external application in Google manuals here.
Please follow the steps in Exposing Your Database to API Express.
- Login to your Appery online account.
- In the Appery.io builder, go to the API Express tab and click Create new DB connection, fill in all the required information and enter its name.
- In the next window, add your Database connection name, select MySQL as Database type, and add Host (IPv4 address attached to your Cloud SQL instance – see above).
- Now, define Port (3306 – the default MySQL port), Database name, Username and Password for your MySQL DB (Google Cloud account) created earlier (see above).
You have now created an Appery.io DB connection. To ensure that the connection from the API Express services to your Google SQL Cloud works, click Test.
Updated 8 months ago