This time it should prompt you to enter password first, $ su - postgres Let’s try to switch to postgres user and connect to database. $ psql -c "ALTER USER postgres WITH PASSWORD ‘xxxxxxxxxxx' " Now to secure database, set password to postgres user using passwd command. 5) Securing PostgreSQL 15 Databaseīy default, postgresql database is not secure, one can easily switch to postgres user without any password and start using psql as shown below: To verify its service status, run $ sudo systemctl status postgresql-15Ībove output shows that postgresql service is up and running. Run the following systemctl commands to start and enable postgresql 15 service. To initialize PostgreSQL 15 initdb database, run $ sudo /usr/pgsql-15/bin/postgresql-15-setup initdb 3) Initialize PostgreSQL Database (initdb) Now, let initialize its database in the next step. $ psql -VĪbove command’s output shows PostgreSQL 15.1 is installed on the system. Once postgresql and it’s dependencies are installed, verify its version using following psql command. $ sudo dnf install postgresql15-server -y In step 1, we have already configured PostgreSQL 15 package repository, so to install it, run the beneath dnf command. So, let’s first enable its DNF/yum package repository using following dnf command. PostgreSQL 15 is not available in the default package repositories of RHEL 9. 1) Enable PostgreSQL 15 Package Repository
0 Comments
Leave a Reply. |