Create a Cloud SQL instance
- Go to the Cloud SQL Instances page in the Google Cloud Platform Console.Go to the Cloud SQL Instances page
- Select your project and click Continue.
- Click Create Instance.
- Click PostgreSQL.
- Enter
myinstance
for Instance ID. - Enter a password for the postgres user.Use the default values for the other fields.
- Click Create.You are returned to the instances list; your new instance is greyed out while it initializes and starts.
Configure access to your Cloud SQL instance
To configure access to your instance:
- Go to the Cloud SQL Instances page in the Google Cloud Platform Console. Go to the Cloud SQL Instances page
- Click the instance to open its Overview page, and record its IPv4 address.
- Log in to the client machine where your psql client is installed.
- Click What’s my IP to determine the IP address of the client machine.
- In the Instances page in the Google Cloud Platform Console, click the instance to open its Overview page.
- Select the Connections tab.
- Under Authorized networks, click Add network and enter the IP address of the client machine where your client is installed.
- Click Done, then click Save at the bottom of your page to save your changes.
- Connect to your instance, either with SSL or without SSL.
Dont forget to allow access in firewall!
PORT : 5432