Plugging holes in the universe, what are you doing today? RSS 2.0
 Saturday, October 11, 2008

Sometime back in July or August Microsoft slipped out a driver for PHP 5 on windows. It uses the SQL Native Client which means that it also supports automatic transparent client redirect. Change this connection info array from:

$connectionInfo = array("Database"=>"AdventureWorks",
                            "UID"=>"sa",
                            "PWD"=>"foobar23$");

to

 

$connectionInfo = array("Database"=>"AdventureWorks",
                            "UID"=>"sa",
                            "PWD"=>"foobar23$",
                            "Failover_Partner"=>"mirror.sql.local");

 

and you've now got automatic failover capability. You need to be running a witness for this magic to happen. If you're running on a Linux box this capability is not available but you can always try something like:

 

http://www.evolt.org/failover-database-connection-with-php-mysql

Saturday, October 11, 2008 4:48:13 AM UTC  #    -

Now Playing
Top Artists This Week
Fluff

Powered by FeedBurner
Categories
Archive
<October 2008>
SunMonTueWedThuFriSat
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010
Kevin Kenny
Sign In
Statistics
Total Posts: 206
This Year: 2
This Month: 2
This Week: 2
Comments: 140
All Content © 2010, Kevin Kenny
DasBlog theme 'Business' created by Christoph De Baene (delarou)