3 ms·
What is your platform? If it is Debian then it is as simple as this to install PostgreSQL and set up a PostgreSQL root user with the same username as your UNIX
by jeltz 15y ago
What is your platform? If it is Debian then it is as simple as this to install PostgreSQL and set up a PostgreSQL root user with the same username as your UNIX username (this to avoid having to modify pg_hba and and also not having to specify user when connecting to PostgreSQL).
sudo apt-get install postgresql
sudo -u postgres createuser -s `whoami`
After this you an just create a database and connect to it with:
createdb my_db
psql my_db
- boyter 15y agoUsually Ubuntu, so I will have a look at this. However when running an application say in PHP its going to be running under the Apache user. How do I go about configuring that?
- jeltz 15y agoI see, I usually do ruby development so the webserver is then usually running as my user on my development machine (obviously that is not the case in production). In your case, then I would just change pg_hba to allow all local connections as shown by moe above. (I would not set any password though since that is normally not useful or necessary for local development).
- KC8ZKF 15y agosudo -u postgres createuser -s `whoami` Won't this create another user named "postgres"? EDIT: No it won't: Ophelia ~ $ sudo -u postgres whoami postgres Ophelia ~ $ sudo -u postgres echo `whoami` rich That seems straight out of The Unix Hater's Handbook.