Difference between revisions of "Connect to Remote PostgreSQL Database"

From Gejoreuy
Jump to navigation Jump to search
(Created page with "== Purpose == This topic describes how to use the psql command to connect to PostgreSQL database from Linux terminal. == Import the Dump File == Just run below command and...")
 
 
Line 15: Line 15:
 
* hostname: The hostname of the PostgreSQL database.
 
* hostname: The hostname of the PostgreSQL database.
 
* port: The port number of the PostgreSQL database.
 
* port: The port number of the PostgreSQL database.
* dbname: The name of the of the database.
+
* dbname: The name of the database.

Latest revision as of 18:37, 22 July 2020

Purpose

This topic describes how to use the psql command to connect to PostgreSQL database from Linux terminal.

Import the Dump File

Just run below command and change it with the database value.

[root@gejoreuy ~]# psql -U username -h hostname -p port dbname

Note :

  • username: The username to log on to PostgreSQL database.
  • hostname: The hostname of the PostgreSQL database.
  • port: The port number of the PostgreSQL database.
  • dbname: The name of the database.