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 The third command installs some required packages like the command line HTTP clients curl and wget. 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 wget command in the terminal: sudo apt-get update -y Basic understanding of command-line tools.Root privileges are configured on the server.Ubuntu 20.04 is installed on the server.We’ll need to make sure the following prerequisites are installed before we can install PostgreSQL and pgAdmin4: pgAdmin4 is a graphical user interface tool that allows users to manage their PostgreSQL databases from one place without having to use complicated command-line instructions or terminal commands like many other similar tools on the market offer. It supports all of SQL:2003 standards, which makes it great for storing any type of data. Postgres is an open-source, powerful relational database system that lets users create, edit, share, and store data quickly and flexibly. If you’re looking for a quick and easy way to install PostgreSQL and pgAdmin4 in Ubuntu 20.04, this post is for you! We’ll walk you through the whole process step-by-step, so it’s easy for anyone to do.
0 Comments
Leave a Reply. |