For performance reasons, LXR stores the references in a database.
Presently, LXR cooperates with Postgresql, MySQL or Oracle, at your choice.
Creation
Database creation can only be done by a DB-user who has the privilege
to create databases.
Contact your site administrator if you can't or don't know how to proceed.
- Postgresql
Create a user for LXR
and give him the permission to create databases:
$ createuser lxr
Create a database for LXR:
$ createdb -U lxr lxr
- MySQL
Run MySQL as an administrator
(often root
) to create user lxr
with right to create databases:
$ mysql -u root -p
Enter password: xxxx
mysql> create user 'lxr'@'localhost' identified by 'lxrpassword';
mysql> exit
It is more comfortable, less error-prone
and requires less expertise to use
phpMyAdmin to do that if you have it installed.
- Oracle
There is no special step to create a database.
Configuration
DB table initialisation is done with interactive script
initdb-config.sh.
Default answer is shown uppercase.
If it fits your need, just hit "return".
Otherwise type your choice.
CAVEAT!
If you restart this step,
first remove any initialisation script from lxrconf.d/
(command shown for default case):
$ rm lxrconf.d/*.sql
$ ./scripts/initdb-config.sh
*** initdb script configurator for LXR ($Revision: 1.3 $) ***
In case you make a mistake, you can cancel the
whole process by typing ctl-C.
Which is your database engine? [MYSQL/oracle/postgres] >
Which is your database name? [lxr] >
Which table prefix will you use? [lxr_] >
Under which user name will you connect to the database? [lxr] >
Output script name? [lxrconf.d/initdb-mysql-custom.sql] >
Your database engine is mysql
Your database is lxr
The tables are prefixed with lxr_
You connect as lxr
Configuration script in lxrconf.d/initdb-mysql-custom.sql
Is this correct? [YES|no] >
Notes:
If you answer yes
,
a DB table initialisation script is written in lxrconf.d/.
Init script saved in lxrconf.d/initdb-mysql-custom.sql
Multiple trees operation
Launch this script for every tree managed by LXR
without changing the database engine;
each partial output is appended to the end of the initialisation script.
Initialisation
The customised script is then processed by the database engine:
- Postgresql
$ psql -U lxr lxr
> \i lxrconf.d/initdb-postgres-custom.sql
Just ignore the errors about unimplemented functions.
- MySQL
$ mysql -u root -p < lxrconf.d/initdb-mysql-custom.sql
Enter password: xxxx
- Oracle
$ sqlplus
SQL> @lxrconf.d/initdb-oracle-custom.sql;