![]() ![]() You can do this by pressing the "Ctrl+Alt+T" keyboard shortcut or by searching for the "Terminal" application in the Ubuntu Dash.Ģ. First, open the terminal on your Ubuntu operating system.The following steps will help you smoothly install PostgreSQL on your Ubuntu operating system: With its powerful features, flexibility, and ease of use, PostgreSQL is an excellent choice for developers and organizations looking for a reliable, high-performance RDBMS. It is often used for web applications, data warehousing, and analytics, among other applications. PostgreSQL is widely used by organizations of all sizes, including large corporations, government agencies, and non-profit organizations. It also has powerful security and replication capabilities that make it suitable for use in enterprise-level applications. PostgreSQL offers many features, including support for multiple programming languages, data types, transaction processing, and scalability. PostgreSQL is free to use and is supported by a large and active community of developers and users who contribute to its development, documentation, and maintenance. It is considered one of the most advanced RDBMSs available and is known for its stability, reliability, and robustness. PostgreSQL is a powerful open-source relational database management system (RDBMS) that uses and extends the SQL language. Whether you're a developer looking to use PostgreSQL for your project or a system administrator tasked with setting up a new database server, this tutorial will provide you with all the necessary instructions to install PostgreSQL on Ubuntu. In this guide, we'll walk you through the steps required to install PostgreSQL on Ubuntu and get you up and running in no time. If you want to install PostgreSQL on Ubuntu, you're in luck, as the process is relatively straightforward. PostgreSQL is a powerful and popular open-source relational database management system many organizations and developers worldwide use. What Are the Benefits of Installing PostgreSQL on Ubuntu You can also remove PostgreSQL commands history file: rm -rf ~/.List of content you will read in this article: Remove PostgreSQL user: sudo deluser postgres Remove GPG key and repository: sudo rm -rf /etc/apt//pgdg.asc Run the following command if you want to completely remove any package with a name that starts with postgresql and anything related to it: sudo DEBIAN_FRONTEND=noninteractive apt purge -autoremove -y postgresql* Now we can connect to the PostgreSQL server from remote host: psql -h 192.168.0.48 -U postgres Uninstall PostgreSQL Restart PostgreSQL service: sudo service postgresql restart We also we need to execute the following commands to add two lines in the pg_hba.conf file for accepting IPv4 and IPv6 remote connections: echo 'host all all 0.0.0.0/0 scram-sha-256' | sudo tee -a /etc/postgresql/14/main/pg_hba.confĮcho 'host all all ::/0 scram-sha-256' | sudo tee -a /etc/postgresql/14/main/pg_hba.conf The following command replaces #listen_addresses = 'localhost' line to desired line: sudo sed -i -e "s/#listen_addresses = 'localhost'/listen_addresses = '*'/" /etc/postgresql/14/main/nf Remote access to the PostgreSQL server can be enabled by adding listen_addresses = '*' in the nf file. Now try to connect to server using password: psql -h 127.0.0.1 -U postgresīy default, PostgreSQL server listens only for local client connections. Before that, we need to run the following command to set password for postgres superuser: sudo -u postgres psql -c "ALTER USER postgres with password 'pwd123' " Peer authentication retrieves the client's OS username and compares it with the allowed database username.Ī postgres superuser also can connect by providing a password. By default, postgres superuser doesn't have password and use peer authentication which only supported on local connections. Sudo service postgresql restart Configuring PostgreSQLĭuring PostgreSQL installation, a postgres superuser has been created. We can also stop, start and restart the service: sudo service postgresql stop The following command can be used to check if PostgreSQL service is running: sudo service postgresql status When installation is completed, we can check PostgreSQL server version: pg_config -version Run the following command to install PostgreSQL 14: sudo apt install -y postgresql-14 Update the package lists: sudo apt update Install PostgreSQLĭownload GPG key: sudo wget -qO /etc/apt//pgdg.asc Īdd repository: echo "deb $(lsb_release -sc)-pgdg main" | sudo tee /etc/apt//pgdg.list This tutorial shows how to install PostgreSQL 14 on Ubuntu 20.04. PostgreSQL is an open-source project that available under the PostgreSQL License. PostgreSQL is a cross-platform relational database that allows to access data using SQL language. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |