![]() ![]() Next, go to the remote machine and run the following command to verify the PostgreSQL connection: psql -h your-server-ip -p 5432 -U postgres -W Next, you can verify the PostgreSQL listening connection with the following command: netstat -antup | grep 5432 Then, restart the PostgreSQL service to apply the changes: systemctl restart postgresql-12 Save and close the file when you are finished. Replace it with the following line: host all all 0.0.0.0/0 md5 You can do it by editing pg_hba.conf file: nano /var/lib/pgsql/12/data/pg_hba.confįind the following line: host all all 127.0.0.1/32 ident Then, you will also need to configure PostgreSQL to accept remote connections. You can configure PostgreSQL server for remote connection by editing nf file: nano /var/lib/pgsql/12/data/nfįind and change the listen_addresses value to * as shown below: listen_addresses = '*' Next, exit from the PostgreSQL shell with the following command: exit Step 5 – Configure PostgreSQL Server for Remote Accessīy default, PostgreSQL is configured to listen on the localhost so that only local applications can connect to the database server, restricting external applications from connecting to the database. Next, set a new password with the following command: psql -c "alter user postgres with password 'password'" To set a password, log in to the postgres user with the following command: su - postgres It is recommended to set a PostgreSQL password for security reasons. You should see the following output: tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 30317/postmaster Step 4 – Set PostgreSQL Admin Passwordĭuring the PostgreSQL installation, a new user called postgres is created without a password. You can also check the PostgreSQL service with the following command: netstat -antup | grep 5432 Mar 22 11:33:01 centos8 systemd: Starting PostgreSQL 12 database server. └─27109 postgres: logical replication launcher Loaded: loaded (/usr/lib/systemd/system/rvice enabled vendor preset: disabled)Īctive: active (running) since Sun 11:33:01 EDT 26s agoĬGroup: /system.slice/rvice You can check the status of the PostgreSQL service with the following command: systemctl status postgresql-12 Next, start the PostgreSQL service and enable it to start after system reboot with the following command: systemctl start postgresql-12 ![]() You should get the following output: Initializing database. Step 3 – Manage PostgreSQL Serviceįirst, initialize the PostgreSQL database with the following command: /usr/pgsql-12/bin/postgresql-12-setup initdb Once the PostgreSQL server has been installed, you can proceed to the next step. Next, install PostgreSQL 12 with the following command: dnf install postgresql12 postgresql12-server -y ![]() Next, disable the built-in PostgreSQL module by running the following command: dnf -qy module disable postgresql You can add it with the following command: dnf install -y dnf update -y Step 2 – Install PostgreSQL 12īy default, the latest version of PostgreSQL is not available in CentOS 8 default repository, so you will need to add the PostgreSQL repository to your system. ![]() Once you are logged into your CentOS 8 server, run the following command to update your base system with the latest available packages. Connect to your Cloud Server via SSH and log in using the credentials highlighted at the top of the page. Create a new server, choosing CentOS 8 as the operating system with at least 1GB RAM. Step 1 – Create Atlantic.Net Cloud Serverįirst, log in to your Atlantic.Net Cloud Server. A root password configured on your server.A fresh CentOS 8 VPS on the Atlantic.Net Cloud Platform.In this tutorial, we will explain how to install the PostgreSQL server on CentOS 8. If you are looking for enterprise-class database solutions, then PostgreSQL is the best choice for you. It also offers several library interfaces including JDBC, ODBC, OCI, libpq, C/C+, PHP. PostgreSQL supports many programming languages including Java, Python, Ruby, Perl, PHP and pgSQL. PostgreSQL comes with many advanced features that allow you to build complex applications. PostgreSQL is known for its robustness, high availability, data integrity, reliability and ease of installation. PostgreSQL was developed by the PostgreSQL Global Development Group and is available for various platforms, including Linux, Microsoft Windows, and Mac OS X. PostgreSQL is a free and open-source object-relational database management system. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |