[exim] Different MySQL connections for different jobs

Top Page
Delete this message
Reply to this message
Author: Mike Cardwell
Date:  
To: exim-users
Subject: [exim] Different MySQL connections for different jobs
Hi,

I have a master database. I replicate that out to slave databases that
sit locally on each mail server. Exim then reads configuration from
those local copies.

I now have a need to write to the database from exim as well. I obviously
can't write to the local read only slave copies of the database. I need
to write to the master. Is there a way of setting up more than one MySQL
server in an exim configuration and then explicitly choosing which one
to use when you run a query? I'm guessing not, but still thought I'd
ask...

I could hack around it by writing a daemon which listens for socket
connections from exim, and then "proxies" commands to the master db. That
would be nasty though.

I nice solution would be for you to be able to do:

hide mysql_servers = named_database1=localhost/dbname1/dbuser1/dbpass1: \
                     named_database2=otherhost/dbname2/dbuser2/dbpass2


And then name your database in the lookup:

${lookup mysql{named_database1}{THE QUERY}{$value}}

Or similar.

Thanks,
Mike