lawn-128-61-59-74:~ postgres$ createuser -R -P -S -D fhir
After running "brew install postgresql" and running postgres, when running the above command I am getting the following error:
"-bash: createuser: command not found"
lawn-128-61-59-74:~ postgres$ createuser -R -P -S -D fhir
After running "brew install postgresql" and running postgres, when running the above command I am getting the following error:
"-bash: createuser: command not found"
run:
sudo find / -name createuser
This will find where the createuser
command is located on your machine. Add what you find to your path.
This probably means that Postgres is not in your PATH
.
Since you installed with Homebrew, your PATH
should include
Applications/Postgres.app/Contents/Versions/9.6/bin
You can add this line to your .bash_profile
to fix that
export PATH="Applications/Postres.app/Contents/Versions/9.6/bin:$PATH"
(Note: 9.6
is the version -- this may be different for you.)
If you didn't use brew
to install Postgres you can use Vao Tsun's answer to find where Postgres is on your machine, and add that to your path instead
From your console/putty/shell you can connect to PgSQL running:
su - postgres -c "psql"
then you can run/execute yours commands/QUERYS...
CREATE USER synapse;
ALTER USER synapse WITH ENCRYPTED password 'I-love-Stackoverflow.com-xD';
CREATE DATABASE synapse ENCODING 'UTF-8' LC_COLLATE='en_US.UTF-8' LC_CTYPE='en_US.UTF-8' template=template0 OWNER synapse;
if you have some trouble, then first try creating a ROLE:
CREATE ROLE synapse;
DROP ROLE synapse;
and after you can CREATE users...
Regards