I installed postgresql and geodjango on Mac OSX following this tutorial word for word. For some reason
sudo su - postgres
does not work. I put in my sudo password, but when I type "whoami" it's still my normal user login.
I know there is postgres user after I saw the list from
dscl . -list /Users UniqueID
Any idea why this is happening? I installed PSQL 9.1.1 server version.
Thank you.
This can be done by typing the following command into a terminal: This will start up a postgres server hosted locally on port 5432. The server will be run out of the directory /usr/local/var/postgres . This will connect to the server and access the postgres database.
CREATE ROLE sa WITH LOGIN PASSWORD 'some-password. '; CREATE DATABASE master WITH OWNER sa; \c master; Now you are running this script using "psql" command line interface (CLI), so you get the message as below... CREATE ROLE CREATE DATABASE You are now connected to database "master" as user "postgres".
To be sure that PostgreSQL is running, you can also restart it with systemctl restart postgresql. If this does not fix the problem, the most likely cause of this error is that PostgreSQL is not configured to allow TCP/IP connections. To correct this, edit your posgresql. conf file.
The postgres account probably has disabled login rights and/or /bin/false as the login shell.
In this case you had best invoke postgresql commands directly, eg: sudo -u postgres psql
That should work even with a disabled login shell.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With