Skip to content

Instantly share code, notes, and snippets.

@Javvadilakshman
Last active August 29, 2015 14:18
Show Gist options
  • Select an option

  • Save Javvadilakshman/937b5b6ca3183b479619 to your computer and use it in GitHub Desktop.

Select an option

Save Javvadilakshman/937b5b6ca3183b479619 to your computer and use it in GitHub Desktop.
Postgresql Related command,Snippets ,Etc..

mysqlmysql

### Commands,Snippets..
You could have postgre installed on localhost with password (or without user or password seted after instalation) but if we are developing we really don't need password, so configuring postgre server without password for all your rails project is usefull.
## Install Postgre packages
* postgresql
* postgresql-client
* libpq-dev
## Install Postgre gem
/Gemfile
gem 'pg'
## Configuration
1. Edit postgre configuration file:
sudo gedit /etc/postgresql/POSTGRE_VERSION/main/pg_hba.conf
2. Change all configuration access to:
# Database administrative login by Unix domain socket
local all all trust
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
3. Restart postgre server
sudo /etc/init.d/postgresql restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment