Modify the config file to allow local connections:sudo apt-get install postgresql-8.4 postgresql-client-8.4 python-psycopg2
Add the line:sudo nano /etc/postgresql/8.4/main/pg_hba.conf
Save the changes to the file and restart the server.local all all md5
Set the password for the postgres user:sudo /etc/init.d/postgresql restart
Change to the postgres user:sudo passwd postgres
Create a new Database:su - postgres
Login to the postgres shell and point to our new database:createdb mydb
Now from the postgress shell create a user and give him access to the database:psql mydb
Done!mydb=> CREATE USER myuser WITH PASSWORD 'myPassword'; mydb=> GRANT ALL PRIVILEGES ON DATABASE mydb TO myuser; mydb=\q
Source: Videntity's Blog
No comments:
Post a Comment