An Interest In:
Web News this Week
- March 22, 2024
- March 21, 2024
- March 20, 2024
- March 19, 2024
- March 18, 2024
- March 17, 2024
- March 16, 2024
Install and config PostgreSQL on Ubuntu Linux
First we need to install PostgreSQLsudo apt get install postgresql postgresql-contrib
Now we check the path for PostgreSQL(for me it is version 12, it might be different for you)ls /etc/postgresql/12/main/
This allows us to check all of the commands available to usservice postgresql
This will allow us to check the statusservice postgresql status
This will log us in as the default usersudo su postgres
Now if we run psql
we will enter the postgresql cli.
From here, you can run \l
to see the default databases.
You can also run \du
to list all of the users.
To change the password of the default user 'postgres', run ALTER USER postgres WITH PASSWORD 'test123';
To create a new user:CREATE USER nova_glow WITH PASSWORD 'test123';
Now if we want to give our new user "super" access...ALTER USER nova_glow WITH SUPERUSER;
If You want to remove a user, simply do the following:DROP USER user_2;
If you want to see all of the available commands for psql, you can simply run man psql
in a new shell.
Note: It is recommended to install pgadmin
from the software center.
Original Link: https://dev.to/anthonygilbertt/install-and-config-postgresql-on-ubuntu-linux-4djd
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To