The following discussion assumes that you wish to enable TCP/IP connections and use the MD5 method for client authentication. Please refer to the PostgreSQL Administrator’s Guide if you would like to configure alternatives like Kerberos. In Ubuntu, peer is the default authentication method used for local connections, while scram-sha-256 is the default for host connections (this used to be md5 until Ubuntu 21.10). PostgreSQL supports multiple client authentication methods. The database service is automatically configured with viable defaults, but can be customised based on your specific needs. To install PostgreSQL, run the following command in the command prompt: sudo apt install postgresql PostgreSQL (also known as Postgres) is an object-relational database system that has the features of traditional commercial database systems with enhancements to be found in next-generation database management systems (DBMS). In this guide, we have demonstrated the step-by-step instructions to install, use, and remove the PostgreSQL database on Ubuntu 22.04.Multi-node configuration with Docker-Composeĭistributed Replicated Block Device (DRBD) To use the PostgreSQL database, provide the default login credential “ $ sudo -u postgres psql”. Then, install PostgreSQL by utilizing the “ $ sudo apt install postgresql-client postgresql -y” command. To install PostgreSQL on Ubuntu 22.04, import the GPG key, and add the repository of PostgreSQL database into the system. We have demonstrated the procedure to install, use, and remove PostgreSQL database on Ubuntu 22.04. Utilize the following command to remove the directory of PostgreSQL: sudo rm -rf /etc/postgresql/ Hit the “ Yes” option:īelow displayed output indicates that PostgreSQL is removed successfully from Ubuntu 22.04: Meanwhile, the “ Package Configuration” wizard will prompt you to confirm the removal of the PostgreSQL database. To remove the PostgreSQL database from Ubuntu 22.04, execute this command: sudo apt-get -purge remove postgresql postgresql-* Want to remove the PostgreSQL database from Ubuntu 22.04? Have a look at the following section! PostgreSQL Database removal from Ubuntu 22.04 Then, type “ exit” to quit from the PostgreSQL shell: # exit In the next step, grant privileges of database to the new user: # grant all privileges on database itslinuxfoss to itslinux Now, create a new user, and specify the username and password in the below-mentioned command: # create user itslinux with encrypted password 'root' We have created “ itslinuxfoss” PostgreSQL database: # create database itslinuxfoss Make a new database and specify its name. Run the following command to log in to PostgreSQL on Ubuntu 22.04: $ sudo -i -u postgresĮxecute “ psql” to get the interactive interface of PostgreSQL: $ psqlĪlternatively, you can run the below command for the same purpose: $ sudo -u postgres psql On Ubuntu 22.04, utilize the provided instructions to set up the PostgreSQL database. PostgreSQL Database set up on Ubuntu 22.04 We have successfully installed the PostgreSQL database on Ubuntu 22.04. In order to start PostgreSQL services, use the mentioned command: $ sudo systemctl start postgresql Let’s move ahead to start the PostgreSQL service. Install PostgreSQL on Ubuntu 22.04 with the provided command: $ sudo apt install postgresql-client postgresql -yĬheck the service status of PostgreSQL on Ubuntu 22.04: $ systemctl status postgresql In the next step, add the PostgreSQL repository into the system: $ echo deb jammy-pgdg main | sudo tee /etc/apt//postgresql.listĪgain, update the system packages: $ sudo apt update Install additional dependencies on Ubuntu 22.04: $ sudo apt install software-properties-common apt-transport-https wget -yĪfter that, import the GPG key of PostgreSQL by utilizing the below command: $ sudo wget -O- | gpg -dearmor | sudo tee /usr/share/keyrings/postgresql.gpg Open up the terminal using “ CTRL+ALT+T” and update and upgrade the system packages: $ sudo apt update & sudo apt upgrade -y On Ubuntu 22.04, to install the PostgreSQL database, follow the steps given below. PostgreSQL Database installation on Ubuntu 22.04 The following post will describe how to install, use, and uninstall PostgreSQL in Ubuntu 22.04. PostgreSQL is a more executable, reliable, and secure database management system. It supports Structure Query Language and provides modern features such as updatable views, transactional integrity, multi-version concurrency management, applied keys, and queries. PostgreSQL is a free, open-source, and powerful object-relational database.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |