Skip to content

Database setup

Jan Stolarek edited this page Sep 19, 2016 · 16 revisions

To run Links programs that manipulate the database you need to install one of the following database engines on your system: MySQL, PostgreSQL, SQLite or MonetDB. Once you have done that you need to compile Links with at least one of these database backends enabled.

PostgreSQL

  1. Install postgresql package using your package manager, eg. on Debian or Ubuntu this will be something like:

    apt-get install postgresql
    

    Once you've done that you need to configure the database by creating a new user and creating at least one database for that user. If you want to run the Links test suite you should create a database called links. Refer to PostgreSQL documentation for instructions how to manage users and databases.

  2. Install OCaml bindings for PostgreSQL. This can be done using OPAM:

    opam install postgresql
    

    Note that these bindings require some extra development libraries installed on your system. OPAM will guide you in case these are missing.

  3. Define POSTGRESQL_LIBDIR environment variable to point to the installation director of PostgreSQL OCaml bindings. If you used OPAM this will by default be in ~/.opam/SWITCH_VERSION/lib/postgresql, where SWITCH_VERSION is the version of the switch you are currently using. You can define this variable on the command line and run make like this:

    POSTGRESQL_LIBDIR=$HOME/.opam/4.03.0/lib/postgresql make