You are connected to database "postgres" as user "postgres" via socket in "/var/run/postgresql" at port "5432". The output displays the database name, the account you are logged in to, the socket path, and the port number. If you want to see details of the connection, use the command: You should receive the following output: psql (14.5) To access the PostgreSQL console execute the following command on your server: sudo -u postgres psql systemctl restart postgresql-14 Step 5: Accessing the PostgreSQL console Save the file, close it, and restart the PostgreSQL service for the changes to take effect. Then you need to edit the /var/lib/pgsql/14/data/pg_hba.conf file and add the following entry at the end of the file. To allow remote access so PostgreSQL can be accessed from everywhere, you need to open the /var/lib/pgsql/14/data/nf file and replace the line: listen_addresses = 'localhost' Step 4: Allow Remote Accessīy default, PostgreSQL is configured to “localhost”. Passwd: all authentication tokens updated successfully.Ī confirmation notification will be displayed ‘ all authentication tokens updated successfully.’Īfter successfully changing the new password, now, on each PostgreSQL access, you need to enter a new reset password for confirmation. The prompt will ask you to enter the new password and then again retype the new password. Using the following command, you can change the default user password for PostgreSQL: passwd postgres You can change or create the user password for PostgreSQL. You should receive the following output: tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 26248/postmaster Step 3: Set the PostgreSQL user password └─26256 "postgres: logical replication launcher "Īnother way to check about the PostgreSQL service and port is to run the command below: netstat -tunlp | grep 5432 Loaded: loaded (/usr/lib/systemd/system/rvice enabled vendor preset: disabled)Īctive: active (running) since Fri 22:21:44 CEST 1min 25s agoĬGroup: /system.slice/rvice You should receive the following output: Verify your PostgreSQL installation by checking its version: psql -V OutputĬheck if the service is up and running: systemctl status postgresql-14 systemctl enable postgresql-14 & sudo systemctl start postgresql-14 Once the installation is complete, initialize the PostgreSQL database with the following command: /usr/pgsql-14/bin/postgresql-14-setup initdb Then, you need to update your local package index with the following command: dnf update -yĪt this point, you can install the PostgreSQL server with the following command: dnf install postgresql14 postgresql14-server Let us Install the repository RPM with the following command: dnf install -y The latest PostgreSQL version 14 is not available in the default repository of AlmaLinux 9, so we need to add the official PostgreSQL Repository for the AlmaLinux system.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |