You will get a list of all PostgreSQL databases in the following output: List of databases To list all PostgreSQL databases, run the following command: \l To create a database named wpdb, run the following command: psql Run the following command to set a password for the Postgres user: psql -c "alter user postgres with password 'password'" For security reasons, it is recommended to set a strong password for the Postgres user. How to Install and Use pgAdmin on Ubuntu 18.04 Step 5 – Working with PostgreSQLīy default, the Postgres user is configured without any password. Now, run the exit command two times to exit from the PostgreSQL. You will get the following output: psql (14.2) Next, run the psql command to connect to the PostgreSQL shell: psql You can also use the following method to connect to the local PostgreSQL instance:įirst, switch the user to the PostgreSQL user: su - postgres You will get the PostgreSQL shell in the following output: psql (14.2) Use the following command to connect to the local PostgreSQL instance directly: sudo -u postgres psql There are two ways to connect to the local PostgreSQL instance: You can check it with the following command: ss -antpl | grep 5432 └─8437 postgres: logical replication launcherįeb 16 16:47:32 linux systemd: Starting PostgreSQL 14 database server.įeb 16 16:47:32 linux postmaster: 16:47:32.115 UTC LOG: redirecting log output to logging collector processįeb 16 16:47:32 linux postmaster: 16:47:32.115 UTC HINT: Future log output will appear in directory "log".įeb 16 16:47:32 linux systemd: Started PostgreSQL 14 database server.īy default, PostgreSQL listens on port 5432. Process: 8423 ExecStartPre=/usr/pgsql-14/bin/postgresql-14-check-db-dir $ (code=exited, status=0/SUCCESS)ĬGroup: /system.slice/rvice Loaded: loaded (/usr/lib/systemd/system/rvice disabled vendor preset: disabled)Īctive: active (running) since Wed 16:47:32 UTC 10s ago To check the status of PostgreSQL, run the following command: systemctl status postgresql-14 Next, start and enable the PostgreSQL service using the following command: systemctl start postgresql-14 Once the installation is finished, initialized the PostgreSQL database with the following command: /usr/pgsql-14/bin/postgresql-14-setup initdb Next, run the following command to install the PostgreSQL 14: dnf install postgresql14 postgresql14-server -y How To Secure PostgreSQL Server Step 3 – Install PostgreSQL 14 on Rocky Linux 8įirst, you will need to disable the default PostgreSQL repository: dnf -qy module disable postgresql Once the PostgreSQL 14 repository is added, you can move to the next step. Now, install the PostgreSQL 14 repository using the following command: dnf install Postgresql 13 client, server PostgreSQL server and client module Postgresql 12 client, server PostgreSQL server and client module Postgresql 10 client, server PostgreSQL server and client module Postgresql 9.6 client, server PostgreSQL server and client module You should see the all available PostgreSQL versions in the following output: Last metadata expiration check: 0:19:52 ago on Wednesday 16 February 2022 04:26:10 PM UTC. You can confirm this by running the following command: dnf module list postgresql dnf update -y Step 2 – Add PostgreSQL 14 Repositoryīy default, the latest version of PostgreSQL is not included in the Rocky Linux 8 default repo. Once you are logged in to your server, run the following command to update your base system with the latest available packages. Connect to your Cloud Server via SSH and log in using the credentials highlighted at the top of the page. Create a new server, choosing Rocky Linux 8 as the operating system with at least 2GB RAM. Step 1 – Create Atlantic.Net Cloud Serverįirst, log in to your Atlantic.Net Cloud Server.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |