DEV Community

Talha Munir 🇵🇸
Talha Munir 🇵🇸

Posted on • Edited on

Creating a Cluster, connecting and creating a database in EDB

Follow below tutorial for a quick overview on how to create a cluster and connecting it to a database.

I assumed that you have already made up EDB account follow the link for more information on creating an account in EDB.

Create a cluster:

Creating a cluster

  • On the overview page select Create a new cluster

You will be on the Create Cluster Page

  • You will find options for your cluster. Select according to your requirements.

Connecting to the new Cluster:

  • Select your cluster to get an overview of how it has been configured.
  • Select the overview tab and copy the command. Paste in the terminal where psql is installed.
psql -W "postgres://edb_admin@p-qzwv2ns7pj.pg.biganimal.io:5432/edb_admin?sslmode=require"
Enter fullscreen mode Exit fullscreen mode

The above command will prompt for your password and put you on a sql command line.

Creating a new Database:

We will create a new sample database employee.
Best practice is to isolate data.

  • Create a new employee database.
create user employee with password 'employee_password';
create database employee;
Enter fullscreen mode Exit fullscreen mode
  • Grant the employee role to edb_admin:
grant employee to edb_admin
Enter fullscreen mode Exit fullscreen mode
  • Connect to the employee database. You will be prompted for edb_admin password(the one you provided above)

\connect employee

References:

  1. https://www.postgresql.org/docs/
  2. https://www.enterprisedb.com/docs/biganimal/latest/free_trial/quickstart/

Top comments (0)