Menu

Database_setup

vplg (9)
Tim Schäfer

Database setup

If you want to use the database features of PLCC, you will have to install a PostgreSQL server. You should then use PgAdminIII or the psql command line utility to create a new database user and a database for this user that can be used by PLCC.

The VPLG programs assume the following database settings by default:

database server IP: 127.0.0.1 (installed locally, i.e., on the same computer as VPLG)
database server port: 5432 (PostgreSQL default port)
database user: vplg
database name: vplg
password: none (empty, i.e., authentication set to TRUST for localhost in pg_hba.conf)

You can use whatever user name, password and database name you like. Just remember to adapt the settings in your PLCC config file (~/.plcc_settings) if you did not use the defaults listed above.

To set authentication to TRUST as mentioned above (NOT recommended for production use!), you need the following like in your <postgresql>/data/pg_hba.conf file:</postgresql>

# TYPE  DATABASE        USER            CIDR-ADDRESS            METHOD
host    vplg             all             127.0.0.1/32            trust


Note that the database user should own the database, but he does not need to be a super user. To get everything setup correctly, you could do something like this (don't type the part before the '>'):

user@linux> su
root@linux> sudo postgres
postgres@linux> psql
psql> CREATE ROLE vplg WITH LOGIN;
psql> CREATE DATABASE vplg OWNER vplg;
psql> \q
postgres@linux>



The code above makes you root and then switches to the postgres system user. Then, the psql command is executed as this user because this will make you PostgreSQL admin when connected to the database. Then, we create the database user and the database that VPLG will use.

After making sure you have the correct settings in your VPLG config file (see above), you can make PLCC create the database tables:

./plcc NONE -r

This should drop and re-create all VPLG database tables. (When running this command for the first time, you may receive warnings, just ignore them.)


MongoDB Logo MongoDB