I'm currently running Linux Mint 17.2 XFCE, and am currently taking the Udacity Intro to Relational Databases course. A few days ago I installed PostGreSQL as part of the program. A part of the course involved downloading VM and connecting to it via Vagrant to run things on linux, but I'm already running linux so instead I just downloaded Vagrant in order to access the 'forum.sql' file which comes with it and is part of one of the exercises.
However whenever I try to run forum.sql with the command
psql forum.sql
all I get is the
psql: FATAL: database "forum.sql" does not exist
error. Despite this I'm clearly in the correct directory. When I type 'ls' in the vagrant/forum directory it clearly shows forum.sql.
What am I doing wrong?
psql -d databaseName -U dbUsername -d hostpsqlit gathers your current user (check withwhoami). psql is trying to connect with current user and if it does not exist - it will not connect - that's why you need to explicitly set-Uoption or create role in the database which matches with your terminal user. regarding your error above if you runpsql forum.sqlfor psql it actuallypsql -d forum.psql- the's why you are getting database does not exit.