gaqsem.blogg.se

Postgresql enable remote connections
Postgresql enable remote connections




To do this, run the following command: createdb -O cleopatra egypt Next, we will be assigning cleopatra to a database. A superuser is a user that has all the privileges available on a Postgres instance. I named my user role cleopatra and I made my user a superuser. Shall the new role be a superuser? (y/n) y Here is an example: Enter name of role to add: cleopatra While still being logged in as postgres run the following command to create a new user: createuser -interactive -pwpromptĪ prompt will be shown to you asking you to input your desired user role, name, password, and if you want the user to be a superuser. To create a new user, exit the Postgres shell by executing: \q In this step, you will be creating a new user that will be used to access your Postgres database remotely. You will be shown something similar to this: :~$ psql You can access the Postgres shell by running: psql

postgresql enable remote connections

The server user will be switched from root to postgres. When the process is complete, switch the user to postgres to be able to execute Postgres commands with Postgres default user by running: su - postgres This will install Postgres along with its associated dependencies. When that is done, install Postgres by running: sudo apt-get install postgresql postgresql-contrib

postgresql enable remote connections

Next, update your server packages and dependencies by running: sudo apt-get update

postgresql enable remote connections

Then input your relevant user password or SSH key password if any. Server_ip is the IP address of your server Server_user is your server user you would like to log in with The first thing to do is SSH into your server by running: ssh _ip

postgresql enable remote connections

In this step, you will be installing Postgres on your server.

  • An Ubuntu server, you can quickly provision one from DigitalOcean or any cloud provider.
  • Familiarity with the command line interface.
  • This article setup will allow Postgres connection from any IP address and will not cover specific/authorized IP connection. In this article, we will be learning how to set up a remote Postgres database server to use for your projects. It is highly scalable and widely popular. Postgres is a powerful relational database management system, it can handle large workloads from a single machine to that of a data center. Setting up a remote Postgres database server on Ubuntu 18.04






    Postgresql enable remote connections