Skip to content

Latest commit

 

History

History
41 lines (37 loc) · 1.04 KB

CONFIGURE_DB.md

File metadata and controls

41 lines (37 loc) · 1.04 KB

Configuring DB

  1. Install required dependencies
    $ sudo apt install postgresql postgresql-contrib libpq-dev g++ make -y
  2. Initialize postgres service
    $ sudo service postgresql start
  3. Connect to the postgres user, in case of error try the
    $ psql -U postgres -w
  4. Set password
    postgres=# \password postgres
  5. Create database
    postgres=# CREATE DATABASE $DBNAME;
  6. Initialize database schema, copy all the content of the (SCHEMA)[./schema.sql]
  7. Initialize data runing the init-db npm script
    $ npm run init-db

Troubleshooting

Peer authentication failed

  1. Allow local connections from any user for postgres default user, replacing the XX with your currently installed postgres
    $ sudo vim /etc/postgresql/XX/main/pg_hba.conf
  2. Replace the line containing local all postgres peer with all postgres trust
  3. Restart the postgres service
    $ sudo service postgresql restart