This document provides step-by-step instructions on how to create a Google Cloud SQL database.
- In the Google Cloud Console, navigate to APIs & Services > Library.
- Ensure the right project is selected
- Search for Google Cloud SQL Admin API.
- Click on it, then click Enable.
You can create a Cloud SQL instance using the Google Cloud Console or via the command line.
- In the Google Cloud Console, navigate to SQL.
- Click on Create Instance. You might have to enable Compute Engine API if not already enabled.
- Select PostgreSQL.
- Enter the instance ID, password for the default
postgres
user, and configure other settings (region, machine type, etc.). - Click Create.
- Once the instance is created, click on your instance to view its details.
- In the left-hand menu, click Users.
- Click Add User Account.
- Enter the following details:
- User Name: Choose a username (e.g.,
myuser
). - Password: Set a password for this user.
- User Name: Choose a username (e.g.,
- Click Add to create the user.
Note: It’s good practice to avoid using the default postgres
user for your application and instead create a dedicated user.
- In the left-hand menu, click Databases.
- Click Create Database.
- Enter the following details:
- Database Name: Provide a name for your database (e.g.,
skainnotate_db
).
- Database Name: Provide a name for your database (e.g.,
- Click Create to set up the database.