<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:12pt"><div style="RIGHT: auto"><SPAN style="RIGHT: auto">No, I didn't, but will try it later.<VAR id=yui-ie-cursor></VAR><BR style="RIGHT: auto" class=yui-cursor></SPAN></div>
<DIV></DIV>
<DIV>&nbsp;</DIV>
<div><FONT color=#ff007f size=4 face="bookman old style, new york, times, serif"><I><STRONG>Nancy E. Wichmann, PMP</STRONG></I></FONT></div>
<div><FONT size=2>(781) 697-6344</FONT></div>
<div>&nbsp;</div>
<div><FONT face="arial, helvetica, sans-serif">Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.</FONT></div>
<div><BR>
<BLOCKQUOTE style="BORDER-LEFT: rgb(16,16,255) 2px solid; PADDING-LEFT: 5px; MARGIN-LEFT: 5px">
<DIV style="FONT-FAMILY: arial, helvetica, sans-serif; FONT-SIZE: 12pt">
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt"><FONT size=2 face=Arial>
<DIV style="BORDER-BOTTOM: #ccc 1px solid; BORDER-LEFT: #ccc 1px solid; PADDING-BOTTOM: 0px; LINE-HEIGHT: 0; MARGIN: 5px 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; HEIGHT: 0px; FONT-SIZE: 0px; BORDER-TOP: #ccc 1px solid; BORDER-RIGHT: #ccc 1px solid; PADDING-TOP: 0px" class=hr readonly="true" contenteditable="false"></DIV><B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> "Metzler, David" &lt;metzlerd@evergreen.edu&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> Ms. Nancy Wichmann &lt;nan_wich@bellsouth.net&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Monday, July 11, 2011 4:14 PM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> RE: [support] Dynamic remote database access<BR></FONT><BR>
<DIV id=yiv1948529062>
<STYLE>
<!--
#yiv1948529062   
 filtered  {font-family:Tahoma;panose-1:2 11 6 4 3 5 4 4 2 4;}
#yiv1948529062 filtered  {font-family:"Bookman Old Style";panose-1:2 5 6 4 5 5 5 2 2 4;}
#yiv1948529062 filtered  {margin:1.0in 1.25in 1.0in 1.25in;}

#yiv1948529062  
 _filtered #yiv1948529062 {font-family:Tahoma;panose-1:2 11 6 4 3 5 4 4 2 4;}
 _filtered #yiv1948529062 {font-family:"Bookman Old Style";panose-1:2 5 6 4 5 5 5 2 2 4;}
#yiv1948529062  
#yiv1948529062 p.yiv1948529062MsoNormal, #yiv1948529062 li.yiv1948529062MsoNormal, #yiv1948529062 div.yiv1948529062MsoNormal
        {margin:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New Roman";}
#yiv1948529062 a:link, #yiv1948529062 span.yiv1948529062MsoHyperlink
        {color:blue;text-decoration:underline;}
#yiv1948529062 a:visited, #yiv1948529062 span.yiv1948529062MsoHyperlinkFollowed
        {color:blue;text-decoration:underline;}
#yiv1948529062 p.yiv1948529062msonormal, #yiv1948529062 li.yiv1948529062msonormal, #yiv1948529062 div.yiv1948529062msonormal
        {margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:"Times New Roman";}
#yiv1948529062 p.yiv1948529062msonormal1, #yiv1948529062 li.yiv1948529062msonormal1, #yiv1948529062 div.yiv1948529062msonormal1
        {margin:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New Roman";}
#yiv1948529062 span.yiv1948529062msohyperlink1
        {color:blue;text-decoration:underline;}
#yiv1948529062 span.yiv1948529062msohyperlinkfollowed1
        {color:purple;text-decoration:underline;}
#yiv1948529062 span.yiv1948529062emailstyle191
        {font-family:Arial;color:navy;}
#yiv1948529062 span.yiv1948529062EmailStyle28
        {font-family:Arial;color:navy;}
 _filtered #yiv1948529062 {margin:1.0in 1.25in 1.0in 1.25in;}
#yiv1948529062 div.yiv1948529062Section1
        {}
-->
</STYLE>

<DIV class=yiv1948529062Section1>
<div class=yiv1948529062MsoNormal><FONT color=navy size=2 face=Arial><SPAN style="FONT-FAMILY: Arial; COLOR: navy; FONT-SIZE: 10pt">I tried your test, but I did not get the same behavior as you did.&nbsp; Just adding the url did not make it try and connect. </SPAN></FONT></div>
<div class=yiv1948529062MsoNormal><FONT color=navy size=2 face=Arial><SPAN style="FONT-FAMILY: Arial; COLOR: navy; FONT-SIZE: 10pt">Did you remember to change your base connection to $db_url[‘default’] prior to adding the secondary connection string? </SPAN></FONT></div>
<div class=yiv1948529062MsoNormal><FONT color=navy size=2 face=Arial><SPAN style="FONT-FAMILY: Arial; COLOR: navy; FONT-SIZE: 10pt">&nbsp;</SPAN></FONT></div>
<div class=yiv1948529062MsoNormal><FONT color=navy size=2 face=Arial><SPAN style="FONT-FAMILY: Arial; COLOR: navy; FONT-SIZE: 10pt">Dave</SPAN></FONT></div>
<div class=yiv1948529062MsoNormal><FONT color=navy size=2 face=Arial><SPAN style="FONT-FAMILY: Arial; COLOR: navy; FONT-SIZE: 10pt">&nbsp;</SPAN></FONT></div>
<DIV>
<DIV style="TEXT-ALIGN: center" class=yiv1948529062MsoNormal align=center><FONT size=3 face="Times New Roman"><SPAN style="FONT-SIZE: 12pt">
<DIV style="BORDER-BOTTOM: #ccc 1px solid; BORDER-LEFT: #ccc 1px solid; PADDING-BOTTOM: 0px; LINE-HEIGHT: 0; MARGIN: 5px 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; HEIGHT: 0px; FONT-SIZE: 0px; BORDER-TOP: #ccc 1px solid; BORDER-RIGHT: #ccc 1px solid; PADDING-TOP: 0px" class=hr readonly="true" contenteditable="false"></DIV></SPAN></FONT></DIV>
<div class=yiv1948529062MsoNormal><B><FONT size=2 face=Tahoma><SPAN style="FONT-FAMILY: Tahoma; FONT-SIZE: 10pt; FONT-WEIGHT: bold">From:</SPAN></FONT></B><FONT size=2 face=Tahoma><SPAN style="FONT-FAMILY: Tahoma; FONT-SIZE: 10pt"> Ms. Nancy Wichmann [mailto:nan_wich@bellsouth.net] <BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Monday, July 11, 2011 12:09 PM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> Metzler, David<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [support] Dynamic remote database access</SPAN></FONT></div></DIV>
<div class=yiv1948529062MsoNormal><FONT size=3 face="Times New Roman"><SPAN style="FONT-SIZE: 12pt">&nbsp;</SPAN></FONT></div>
<DIV>
<DIV>
<div style="BACKGROUND: white" class=yiv1948529062MsoNormal><FONT color=black size=3 face=Arial><SPAN style="FONT-FAMILY: Arial; COLOR: black; FONT-SIZE: 12pt">I haven't even gotten as far as to use db_set_active. I was just checking that the settings.php worked as intended, which it does not. Try it on your local site: enter another db connection, but with an incorrect password. At the very least,&nbsp;authentication is happening whether you are physically accessing the DB or not. And when I tried accessing a truly remote DB with correct userid and password, it failed because&nbsp;MySql was trying to add my local IP address to the userid. In this case, I am not an admin in any way, shape, or form on the remote DB and cannot even try adding a user id containing the IP address (whatever it may be today).</SPAN></FONT></div></DIV>
<DIV>
<div style="BACKGROUND: white" class=yiv1948529062MsoNormal><FONT color=black size=3 face=Arial><SPAN style="FONT-FAMILY: Arial; COLOR: black; FONT-SIZE: 12pt">&nbsp;</SPAN></FONT></div></DIV><SPAN>
<DIV>
<div style="BACKGROUND: white" class=yiv1948529062MsoNormal><FONT color=black size=3 face=Arial><SPAN style="FONT-FAMILY: Arial; COLOR: black; FONT-SIZE: 12pt">If this were not under Drupal, I would just try a straight <I><I><FONT face=Arial><SPAN style="FONT-FAMILY: Arial">mysql_connect</SPAN></FONT></I></I>, but i don't think that is very Drupally.</SPAN></FONT></div></DIV></SPAN>
<DIV>
<div style="BACKGROUND: white" class=yiv1948529062MsoNormal><FONT color=black size=3 face=Arial><SPAN style="FONT-FAMILY: Arial; COLOR: black; FONT-SIZE: 12pt">&nbsp;</SPAN></FONT></div></DIV>
<DIV>
<div style="BACKGROUND: white" class=yiv1948529062MsoNormal><B><B><I><FONT color=#ff007f size=4 face="Bookman Old Style"><SPAN style="FONT-STYLE: italic; FONT-FAMILY: 'Bookman Old Style'; COLOR: #ff007f; FONT-SIZE: 13.5pt">Nancy E. Wichmann, PMP</SPAN></FONT></I></B></B><FONT color=black face=Arial><SPAN style="FONT-FAMILY: Arial; COLOR: black"></SPAN></FONT></div></DIV>
<DIV>
<div style="BACKGROUND: white" class=yiv1948529062MsoNormal><FONT color=black size=2 face=Arial><SPAN style="FONT-FAMILY: Arial; COLOR: black; FONT-SIZE: 10pt">(781) 697-6344</SPAN></FONT><FONT color=black face=Arial><SPAN style="FONT-FAMILY: Arial; COLOR: black"></SPAN></FONT></div></DIV>
<DIV>
<div style="BACKGROUND: white" class=yiv1948529062MsoNormal><FONT color=black size=3 face=Arial><SPAN style="FONT-FAMILY: Arial; COLOR: black; FONT-SIZE: 12pt">&nbsp;</SPAN></FONT></div></DIV>
<DIV>
<div style="BACKGROUND: white" class=yiv1948529062MsoNormal><FONT color=black size=3 face=Arial><SPAN style="FONT-FAMILY: Arial; COLOR: black; FONT-SIZE: 12pt">Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.</SPAN></FONT></div></DIV>
<DIV>
<div style="BACKGROUND: white" class=yiv1948529062MsoNormal><FONT color=black size=3 face=Arial><SPAN style="FONT-FAMILY: Arial; COLOR: black; FONT-SIZE: 12pt"><BR><BR></SPAN></FONT></div>
<DIV>
<DIV>
<div style="BACKGROUND: white" class=yiv1948529062MsoNormal><B><FONT color=black size=3 face="Times New Roman"><SPAN style="COLOR: black; FONT-SIZE: 12pt; FONT-WEIGHT: bold">From:</SPAN></FONT></B><FONT color=black><SPAN style="COLOR: black"> "Metzler, David"</SPAN></FONT></div></DIV>
<DIV>
<div style="BACKGROUND: white" class=yiv1948529062MsoNormal><FONT color=black size=3 face="Times New Roman"><SPAN style="COLOR: black; FONT-SIZE: 12pt">&nbsp;</SPAN></FONT></div></DIV>
<DIV id=yiv1948529062>
<DIV>
<DIV>
<div style="BACKGROUND: white" class=yiv1948529062MsoNormal><FONT color=navy size=2 face=Arial><SPAN style="FONT-FAMILY: Arial; COLOR: navy; FONT-SIZE: 10pt">Not sure how you are accessing your remote db, but it seems odd that it should open a connection before one is required. The settings.php shouldn’t cause a connection to the db, it just defines the connection stirng. </SPAN></FONT><FONT color=black><SPAN style="COLOR: black"></SPAN></FONT></div></DIV>
<DIV>
<div style="BACKGROUND: white" class=yiv1948529062MsoNormal><FONT color=navy size=2 face=Arial><SPAN style="FONT-FAMILY: Arial; COLOR: navy; FONT-SIZE: 10pt">&nbsp;</SPAN></FONT><FONT color=black><SPAN style="COLOR: black"></SPAN></FONT></div></DIV>
<DIV>
<div style="BACKGROUND: white" class=yiv1948529062MsoNormal><FONT color=navy size=2 face=Arial><SPAN style="FONT-FAMILY: Arial; COLOR: navy; FONT-SIZE: 10pt">It seems that when set_active is called then the conection gets opened.&nbsp; &nbsp;If that only happens in&nbsp; a cron hook then that should only happen then.&nbsp; Where are your set_active calls coming into play here? </SPAN></FONT><FONT color=black><SPAN style="COLOR: black"></SPAN></FONT></div></DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV><BR><BR></DIV></DIV></BLOCKQUOTE></div></div></body></html>