Supporting MySQL failover

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am looking for a MySQL driver (or configuration) for PHP which will
support fail-over to a slave database in case of a master failure (we
have a MySQL master-slave replication setup). I have already looked at
MySQL proxy and if nothing works, I will end up using it but I was
hoping that PHP has some kind of built in support (through the driver or
otherwise)  for MySQL fail-over (like MySQL JDBC driver has). We would
prefer not to change the application to support fail-over (to slave in
case of master crash).


If you want to see the MySQL JDBC driver configuration for automatic
fail-over, see :

Re: Supporting MySQL failover

Abhijat Vatsyayan wrote:
Quoted text here. Click to load it
Quoted text here. Click to load it

Sorry, no.

But if the application were well designed, you would only need to change
one file (the database class you wrote).

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Re: Supporting MySQL failover

Quoted text here. Click to load it

Don't implement failover in your code - use a virtal IP address for
the database. (By all means notify failure from your code though)


Site Timeline