DEV Community

Adrian Carter
Adrian Carter

Posted on • Updated on

Quick Guide: Accessing a Specific Database in PostgreSQL

  1. Open a terminal or command prompt.
  2. Connect to the PostgreSQL server by running the following command:
psql -U username -h hostname -p port -d database_name
Enter fullscreen mode Exit fullscreen mode

Replace username with your PostgreSQL username, hostname with the server address (usually localhost), port with the PostgreSQL server port (usually 5432), and database_name with the name of the specific database you want to access.

With these straightforward instructions, you can navigate your PostgreSQL databases. Just remember to replace the placeholder values with your actual username, server address, port, and database name.

Top comments (0)