Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
documentation:latest:sqlconfbackend [2018/01/24 11:00]
coudot
documentation:latest:sqlconfbackend [2019/01/15 15:54] (current)
Line 2: Line 2:
  
 There is 2 types of SQL configuration backends for LemonLDAP::​NG:​ There is 2 types of SQL configuration backends for LemonLDAP::​NG:​
-  * **CDBI**: very simple storage +  * **CDBI**: very simple storage ​(recommended) 
-  * **RDBI**: triple store storage ​(recommended)+  * **RDBI**: triple store storage
  
-<note tip>You can use any database engine if it provides a Perl Driver. You will find here examples for MySQL and PostGreSQL, but other engines may also work.</​note>​+<note tip>You can use any database engine if it provides a Perl Driver. You will find here examples for MySQL and PostgreSQL, but other engines may also work.</​note>​
  
 See [[changeconfbackend|how to change configuration backend]]. See [[changeconfbackend|how to change configuration backend]].
Line 75: Line 75:
 type = RDBI type = RDBI
 dbiChain ​   = DBI:​mysql:​database=lemonldap-ng;​host=1.2.3.4 dbiChain ​   = DBI:​mysql:​database=lemonldap-ng;​host=1.2.3.4
 +dbiUser ​    = lemonldaprw
 +dbiPassword = mypassword
 +; optional
 +dbiTable ​   = mytablename
 +</​code>​
 +
 +
 +===== PostGreSQL =====
 +
 +==== Perl Driver ====
 +
 +You need DBD::Pg Perl module:
 +  * Debian:
 +<​code>​
 +apt install libdbd-pg-perl
 +</​code>​
 +  * Red Hat:
 +<​code>​
 +yum install perl-DBD-Pg
 +</​code>​
 +
 +==== Database and table creation ====
 +
 +Create database:
 +<code sql>​CREATE DATABASE lemonldap-ng;</​code>​
 +
 +Use database to create table:
 +<code sql>use lemonldap-ng</​code>​
 +
 +=== RDBI ===
 +
 +<code sql>
 +CREATE TABLE lmconfig (
 +    cfgnum integer NOT NULL,
 +    field text NOT NULL,
 +    value text,
 +    PRIMARY KEY (cfgNum,​field)
 +    );
 +</​code>​
 +
 +=== CDBI ===
 +
 +<code sql>
 +CREATE TABLE lmConfig (
 +    cfgnum integer not null primary key,
 +    data text
 +);
 +</​code>​
 +
 +===== Connection settings =====
 +
 +Change configuration settings in ''/​etc/​lemonldap-ng/​lemonldap-ng.ini''​ file (section configuration):​
 +<code ini>
 +[configuration]
 +type = RDBI
 +dbiChain ​   = DBI:​Pg:​database=lemonldap-ng;​host=1.2.3.4
 dbiUser ​    = lemonldaprw dbiUser ​    = lemonldaprw
 dbiPassword = mypassword dbiPassword = mypassword