<p>I found this:</p>

<p><a href="http://www.evolt.org/failover-database-connection-with-php-mysql" rel="nofollow noreferrer">http://www.evolt.org/failover-database-connection-with-php-mysql</a></p>

<p>and similar examples. But is there a better way?</p>

<p>I am thinking along the lines of the <a href="http://www.microsoft.com/technet/prodtechnol/sql/bestpractice/implappfailover.mspx#EMD" rel="nofollow noreferrer">Automatic Failover Client</a> in the MS SQL Native Client.</p>

No, it does not have that build in. I think an easy way is to employ
MySQL Proxy
. Otherwise, but the
logic
(
```
if (fails) { connect to another }
```
) in your application, but that's not so pretty and great in terms of performance.