sqlpostgresqlpgadmin-4

Not able to create database in pgadmin


I'm new to PostgreSQL and I'm figuring out on how to create the database in pgadmin. My OS is Ubuntu 20.04.

The snap of my pgadmin panel is here

Update: So, if anybody having the same doubt, here the steps :

Go to your terminal and do sudo -u postgres psql to enter into the PostgreSQL command line.

Then create the database:

    CREATE DATABASE databasename;

Create the user:

CREATE USER username WITH PASSWORD 'password';

Finally grant permissions and connect to the database with the new user just created above:

GRANT ALL PRIVILEGES ON DATABASE databasename TO username;

After this, go to your pgAdmin and then create the new server. Give a name to your server. Go to the Connection tab, and enter localhost as your hostname. Edit the username and password which you have created above in command line and save the server.

Done.


Solution

  • This seems to be a new install of PgAdmin. Your first task then is to define the connections to your database. <br./>

    1. In the Left panel right click on Servers.
    2. Click click the Create Server
    3. In resulting dialog enter a User defined name for the connection.
    4. Click the Connection tab.
    5. Complete the connection information as necessary (see image)
    6. Complete SSH, SSL, Advanced tabs as needed (you may need to contact your DBA).
    7. Save and exit pgAdmin (exit may not be necessary, but I always do).
    8. Restart pgAdmin.
    9. Again Left panel, click the > to expand the list of connections.
    10. Double Click the desired database.