Quickstart to Creating a Google Cloud SQL Instance

Kaneel Dias
3 min readOct 21, 2021

--

Cloud SQL is a cloud-based alternative to local MySQL, PostgreSQL, and SQL server databases that is a part of the Google Cloud Platform Suite.

Creating a Project

Login to console.cloud.google.com using your Google account and create a new project. In the process of creating a project, you will have to provide a name for the project, along with a few other details. It will also be required to provide your billing information, however it is worth noting that the Google Cloud Platform does offer a 300 USD worth of free credits for 90 days.

Setting up your Database

After the project is created, on the navigation menu, find “SQL” under the “Databases” section (or alternatively, navigate to console.cloud.google.com/sql/), which should bring you to the following page.

Click on “Create Instance” to create a database. You will be prompted to select between three database engines, MySQL, PostgreSQL and SQL server. For this guide, we will be using MySQL.

Afterwards, you will be prompted to enable the “Compute Engine API” for your project. This will take a few minutes, after which you will be taken to a page to configure your database server. In this page, you can set your Instance ID, password, database version, region, no. of vCPUs, memory and much more. Once you finalize the configurations and click create instance, a new instance of your database server will be created, which will once again take a few minutes.

White-listing your IP address

After the instance is created, you can go ahead and whitelist your IP address to be allowed to connect to the server. This can be done through the “Connections” tab in the navigation bar on the left. Ensure that the “Public IP” checkbox is checked, and click on “Add Network”. Type in a name for your network and your IP address (or range) in CIDR notation, click done, and then save. If you are unsure of your IP address, find it here.

Obtaining the Server Configuration Information

From the “Overview” tab, you can obtain the public IP address of the database server that is required to connect to it. The root username and password for connections will be “root” and the password that was specified when creating the instance. However, if you wish to create separate users for more granular access control, you can do so in the “Users” tab.

Creating a Database

Finally, before connecting to the server, we will need to create a database. This can be done from the “Databases” tab on the left navigation menu. In this page, you can simply specify the name of the database, along with the character set and the collation to create your database.

--

--