[ Contents | << Previous | Next >> ]


MySQL Setup

Kalendus uses MySQL as its database backend. (Alternate databases such as PostgreSQL are in the works.)

Assumption

You have a MySQL database server running.

Create Database and User

[system admin]

Create the MySQL database to use. This can be named whatever you like; I will assume 'calendar'.

Create the MySQL user for the Kalendus scripts to login as. This user must have read and write access (select, insert, update, delete). I will use the 'kalendus' user, and assume the mysql database server is running on 'mysql.example.com' and the apache server is running on 'www.example.com'.

	prompt> mysql -h mysql.example.com -u root -p
	Enter password: ****

	mysql> CREATE DATABASE calendar;

	mysql> GRANT select, insert, update, delete
	       ON calendar.*
	       TO kalendus@www.example.com
	       IDENTIFIED BY 'password';

Save User

In order to connect to the MySQL database, the mysql server hostname, database, username and password must be stored in the cgi-bin/calendar/KalendusConfig.pm file.

	$db_database = 'calendar';
	$db_hostname = 'mysql.example.com';
	$db_username = 'kalendus';
	$db_password = 'password';

Create Kalendus Tables

The install/tables.mysql file contains the definitions of all the tables that Kalendus needs.

The install/data.en.sql file contains the initial data such as month and weekday names, in English.

These can either be redirected into the mysql command line client, as shown below, or simply pasted into a mysql client such as phpmyadmin.

To create the tables, the user must have create priveleges, so the 'kalendus' user created above may not work. Use the root user or some other user that has create priveleges for the 'calendar' database.

	prompt> mysql -h mysql.example.com -u root -p calendar < tables.sql
	Enter password: ****

	prompt> mysql -h mysql.example.com -u root -p calendar < data.en.sql
	Enter password: ****