So we’re going to add the pgAdmin4 repository in order to install it with the apt-get command.įirst, download and add the GPG key for the pgAdmin4 repository, which we’re going to add: curl | apt-key add PgAdmin4 is not available in Ubuntu 20.04 default repository. As you can see in the screenshot below, we’re connected to the PostgreSQL server with our role linuxways and its associated database called linuxways. This command will show all the connections your role, and user linuxways is currently connected with. You can issue any PostgreSQL command to the server from here. This command will open a new psql prompt that is connected with our role linuxways and associated database called linuxways. Once this new user is created, you can use it to connect to the PostgreSQL server by running the following command. It’s required to create a Linux user with the same name as your Postgres role and database. Now that we have a new role and a new database, let’s connect to them. createdb linuxways Opening a Postgres Prompt with the New Role and the New Database Let’s create a new database called linuxways for our role linuxways. You can create a new database by using the createdb command. createuser -interactiveĪ role in PostgreSQL can be associated with one or more databases. All of the following steps must be performed while we’re still logged into PostgreSQL as a postgres user. Let’s create a new account called linuxways. Use the createuser statement to create a new user that will be used to access the PostgreSQL server. This is where you can type all your queries. You will be logged into the PostgreSQL terminal and provided access to all PostgreSQL commands. We will use this account to connect to PostgreSQL. PostgreSQL provides a default account called postgre. sudo systemctl status postgresqlĪs you can see in the output below, the PostgreSQL server daemon is up and running on the server. you can check the status of the installation by running the following command. This command will download and deploy PostgreSQL along with other useful packages that will get installed on the server. Now that we have Ubuntu 20.04 server updated with the latest updates, let’s install PostgreSQL by running the following command in the terminal: sudo apt install postgresql postgresql-contrib -y This command will update our system packages, and upgrade any software that needs to be updated on the server. Sudo apt install wget curl ca-certificates gnupg2 To make sure that we have all the latest updates installed on the server, run the following command in the terminal: sudo apt-get update -y
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |