![]() Open the officical PostgresSQL download page.Ģ. Using this method you are in better control of which exact Postgres version you want to install on your system and also get the latest Postgres installed if needed. Second Method – Install PostgreSQL on CentOS 7 using the PostgreSQL repository If required you can configure PostgreSQL to start on every system reboot automatically. This completes our database installation and initialization. Once the installation is done, you can initialize the database using the below command:Īfter initializing the database, you can start the database using: UsingĪs you can see the version installed on my system is Postgres 9.2. On your CentOS Terminal run the commands mentioned below:Īfter execution is completed check the postgres version that is installed on your system. At the time of writing the repository hosts PostgreSQL version 9.2.15. Note that it may not have the latest version of PostgreSQL. ![]() The CentOS 7 repository contains PostgreSQL. I hope this article would be helpful and knowledgeable for you.First Method – Install PostgreSQL on CentOS 7 using the CentOS repositories We have also shown how you can add tables in the database by using the SQL query. So, we have demonstrated in this article how you install and remove the PostgreSQL server and create a database in PostgreSQL on CentOS 8. To exit from the database type the following command: # \q To list all tables or relations of your database run the below-given command: # \d Here, we can create tables and assigned privileges on this database by pasting the following code in your current database shell which you can also see in the below-displayed screenshot: CREATE TABLE users (Īs you can see the table is created in the above screenshot with the name ‘users’. To test the working of the above-mentioned database execute the following SQL query: SELECT CURRENT_DATE Īs you can see in the above-displayed image, the query is working on this database. Now, access the created database ‘samreenadb’ by using the following command: $ psql samreenadb Now, we have created a new PostgreSQL database with the name ‘samreenadb’ by using the following command: $ createdb samreenadb Login as root on your PostgreSQL database server as follows: If you don’t want to use the PostgreSQL database server on your system then, by using the following command you can remove it: # dnf remove postgresql postgresql-server To know the services running status, use the below-mentioned commands: # systemctl start postgresql # systemctl status postgresql You can enable the services of PostgreSQL by running the following set of commands: # systemctl enable postgresql Step 5: Enable and Start PostgreSQL services To initialize the PostgreSQL database server directory, type the following command on the terminal: # postgresql-setup -initdb Step 4: Initialize the PostgreSQL database Once the installation of PostgreSQL is complete, to verify the working of PostgreSQL databases run the below-mentioned command: # postgres -versionĪs you can see in the above screenshot the Postgres 10.14 is installed on this system. Step 3: Check installed version of PostgreSQL The complete status will display on the terminal that represents the installation of PostgreSQL has been completed. Now, execute the below-given command to install the PostgreSQL server on your system: # dnf install postgresql postgresql-serverĭuring the installation, you need to press ‘y’ and then hit the ‘Enter’ key to confirm the installation of PostgreSQL. It is a recommended and quite an easy step that you should update the repository cache of your system repository or packages by using the following command: # dnf makecacheĪll package has been updated. To complete the installation of PostgreSQL on CentOS 8, you will implement the following steps: Step 1: Update system cache Now, you can run all the administrative commands for PostgreSQL installation. Type the below-mentioned command to log in on your terminal as the root user: $ su Installation of PostgreSQL databases on CentOS 8įirst, you will open the command line application ‘Terminal’ by clicking on the terminal icon from the left sidebar of your desktop. You should be login as the root user or you must have privileges to run the ‘sudo’ command on your system. In this article, we will elaborate on the installation of PostgreSQL on CentOS 8 Linux distribution. This type of database server more emphasis on SQL compliance and extensibility. PostgreSQL, which is popular with a name as Postgres, is an open-source and freely available relational database management system.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |