Re: [Exim] Multiple Databases?

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Colin Morey
Datum:  
To: Colin Morey
CC: exim-users
Betreff: Re: [Exim] Multiple Databases?
>
Sorry for dragging this backup, but i've now found the solution and i believe
the archives would benefit from having it spelled out. Especially as i still
can't find it in the main docs for the 3.3x series.

==
When trying to use more than one database, the mysql driver, (just mysql,
pgsql doesn't work) can create a connection without an explicit database name,
the configuration option for this is,

mysql_servers = "<server>/<database>/<username>/<password>"

and as the database field can be blank we can write,

mysql_servers = "<server>//<username>/<password>"

_but_ when doing a lookup, you need to specify the database to use in the
query.

eg,

${lookup mysql{select password from <database>.users where user='$1'}

It is worth noting that this will allow multiple databses, but only on one
database server :( (specifying multiple servers seems to provide some degree
of fail-over.)

==
Thanks go to Philip Hazel for his execellant book "Exim - The Mail Transfer
Agent".

Cheers,

Colin Morey

> I'm currently running the 3.3x series of exim, and I'm trying to get it to
> query multiple databases for authentication purposes. I know i can list
> multiple databases in the mysql_server setting, but that's just for failover
> purposes.
> I've also tried using "use <dbname>;" before the select in a query, but it
> seems mysql complained maddly about malformed queries :(
>
> Has anyone got this working, or can anyone point me in the right direction.
>
> (is now on his third job and third time of using exim in a row :))
>
> If Anyone can help, I'd greatly appreciate it,
>
> Cheers,
> Colin Morey,
> System Administrator
>
>
>
> --
>
> ## List details at http://www.exim.org/mailman/listinfo/exim-users Exim details at http://www.exim.org/ ##
>
>