[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.2.3 MySQL and PostgreSQL

This is the most flexible database format. GNU Anubis 4.0 supports MySQL(2) and PostgreSQL(3) interfaces. No matter which of them you use, the implementation details are hidden behind a single consistent Anubis interface.

GNU Anubis supposes that all user data are kept in a single database table. This table must have at least four columns for storing SMTP `AUTHID', SMTP password, system account name and path to user configuration file. Among those, only the last two may have NULL values. There is no restriction on the name of the database or the authentication table, nor on its column names. This information may be specified in URL as discussed below.

URL syntax

 
proto://[[user[:password]@host/dbname[params]

Proto describes the exact database type to use. Use `mysql' for MySQL databases and `pgsql' or `postgres' for PostgreSQL databases.

Optional user and password specify authentication credentials used to access the database.

Host sets domain name or IP address of the machine running the database. It may be omitted if the database resides on `localhost'.

The database name is specified by dbname element.

Finally, further details needed for connecting to the database may be given by URL parameters. All of them have reasonable default values, so you'll have to specify only those parameters that does not match the default values. Known parameters are:

port=number
Specifies the port number to be used when connecting to the database. If it is not specified, the behavior depends on the value of socket parameter: if socket is not present, the program will use the default port number for the given protocol (i.e. 3306 for `mysql' and 5432 for `pgsql'.

socket=string
Specifies UNIX name of the socket to connect to. This parameter cannot be used together with port (see above).

bufsize=number
Sets the length of the buffer used to create SQL queries. Default is 1024 bytes.

table=string
Specifies the name of database table keeping where the authentication data are stored. Default is `users'.

authid=string
Specifies the name of a column in table which holds `AUTHID' value. Default is `authid'.

passwd=string
Specifies the name of a column in table which holds user password. Default is `passwd'.

account=string
Specifies the name of a column in table which holds the name of system account to be used for this `AUTHID'. Default is `account'.

rcfile=string
Specifies the name of a column in table which holds path to the user's configuration file. Default is `rcfile'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by Wojciech Polak on December, 18 2004 using texi2html