Short tutorial on how to create databases on postgresql, creating users and granting permissions so that the users has access to the created database.
Create and Apply Permissions
Logon to postgresL
1 2 |
|
Create the database mydb
:
1
|
|
Create the user dba
and assign a password:
1
|
|
Grant all privileges for the user on the database:
1 2 |
|
Allowing Remote Conenctions
If you want to allow remote connections, you would first need to change the config that the server listens on all interfaces:
1 2 |
|
We also the need to update the trust relationship, in this case we will only want one user to access one database from any source:
1 2 3 |
|
After the config is in place, restart the server:
1
|
|
PostgreSQL Client
From a remote source, test the connection to your server:
1 2 3 4 5 6 |
|