Created
November 5, 2013 19:22
-
-
Save jakenotjacob/7324610 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PostgreSQL | |
gem install pg | |
- Postgres interface access through Ruby | |
su - postgres | |
(or use: sudo su … then once logged in as root… su postgres to switch to postgres user) | |
-This will switch to the postgres user for setup | |
Initialize DB Cluster & give access to postgres user | |
systemd-tmpfiles --create postgresql.conf | |
mkdir /var/lib/postgres/data | |
chown -c -R postgres:postgres /var/lib/postgres | |
sudo su - postgres -c "initdb --locale en_US.UTF-8 -E UTF8 -D '/var/lib/postgres/data'" | |
Create Postgres USER | |
createuser -s -U postgres --interactive | |
Change Postgres USER password | |
psql -U postgres | |
>This will get you INSIDE the PostgreSQL console, where you will type... | |
ALTER USER postgres with password 'enterTheNewPasswordHere'; | |
Now, make sure that config/database.yml contains the same USERNAME and PASSWORD that you created for the postgresql user. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment