![]() You need to type the password of the current user and press the Enter keyboard. It’ll prompt you for the password of the current user. To load the sample database into the PostgreSQL database server, you follow these steps:įirst, switch over the postgres account using the following command: $ sudo -i -u postgres Code language: Shell Session ( shell ) To return to your regular system user, you execute the exit command like this: exit Code language: Shell Session ( shell ) Load the sample database This above command will bring you back to the postgres Linux command prompt. To quit the PostgreSQL prompt, you run the following command: postgres=# \q Code language: Shell Session ( shell ) You’ll access the postgres prompt like this: postgres=# Code language: Shell Session ( shell )įrom here, you can interact with the PostgreSQL like issuing a query. Then, you can access the PostgreSQL using the psql by typing the following command: $ psql Code language: Shell Session ( shell ) You need to provide the password and hit the Enter keyboard. It’ll prompt for the password of the current user. To connect to PostgreSQL using the postgres role, you switch over to the postgres account on your server by typing: $ sudo -i -u postgres Code language: Shell Session ( shell ) When you installed PostgreSQL, the installation process created a user account called postgres associated with the default postgres role. If a role exists in PostgreSQL, the same Linux user account with the same name is able to log in as that role. It means that PostgreSQL will associate its roles with the system accounts of Linux. By default, PostgreSQL uses ident authentication. In PostgreSQL, a user account is referred to as a role. Connect to the PostgreSQL database server via psql ![]() It will take few minutes to download and install the PostgreSQL. For example, to install PostgreSQL version 12, you use the following command: $ sudo apt-get install postgresql-12 Code language: Shell Session ( shell ) If you want to install a specific version, you can use postgresql-version instead of postgresql. Third, update the package list: $ sudo apt-get update Code language: Shell Session ( shell )įinally, install the latest version of PostgreSQL: $ sudo apt-get install postgresql Code language: Shell Session ( shell ) Second, import the repository signing key: $ wget -quiet -O - | sudo apt-key add - Code language: Shell Session ( shell ) You need to execute them one by oneįirst, execute the following command to create the file repository configuration: $ sudo sh -c 'echo "deb $(lsb_release -cs)-pgdg main" > /etc/apt//pgdg.list' Code language: Shell Session ( shell ) Once visiting the PostgreSQL download for Ubuntu page, you find the script that allows you to install PostgreSQL on Ubuntu. In this tutorial, we’ll show you how to install PostgreSQL on Ubuntu 20.04. To download and install PostgreSQL on Linux, you visit the download page and select your Linux distribution. ![]() It is recommended that you install PostgreSQL this way since it ensures a proper integration with the operating system including automatic patching and other update management functionality. Most Linux platforms such as Debian, Red Hat / CentOS, SUSE, and Ubuntu have PostgreSQL integrated with their package management. You can now explore the pgAdmin4 web interface and start managing your PostgreSQL server through a web browser.Summary: in this tutorial, you will learn how to download and install PostgreSQL on Linux. Once the connection is established, you should see the following page:Ĭongratulations! you have successfully installed PostgreSQL and pgAdmin4 on Ubuntu 20.04 server. Provide your PostgreSQL host, database user, password and click on the Save button. Provide your servername in General settings then click on the Connections tab. Next, click on the Add New Server to connect to the PostgreSQL server. You should see the pgAdmin4 dashboard in the following page: Provide your email address, password and click on the Login button. Now, you can access the pgAdmin4 web interface using the URL You will be redirected to the pgAdmin4 login page: You can now start using pgAdmin 4 in web mode at Access pgAdmin4 Web Interface Continue (y/n) ? y Apache successfully restarted. Do you wish to continue (y/n) ? y The Apache web server is running and must be restarted for the pgAdmin 4 installation to complete. This involves enabling the wsgi module and configuring the pgAdmin 4 application to mount at /pgadmin4. We can now configure the Apache Web server for you. Enter the email address and password to use for the initial pgAdmin user account: Email address: Password: Retype password: pgAdmin 4 - Application Initialisation = Creating storage and log directories. NOTE: Configuring authentication for SERVER mode. Setting up pgAdmin 4 in web mode on a Debian based platform.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |