<br><br><div class="gmail_quote">On Wed, Jun 15, 2011 at 6:59 PM, Michael Kao <span dir="ltr"><<a href="mailto:michael.kao@ogilvy.co.nz">michael.kao@ogilvy.co.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word">Hi guys,<div><br></div><div>I am trying to establish a connection between R and the MySQL database. However, I am getting the following problem. I have searched previous thread but have not found anything similar any help would be much appreciated.</div>
<div><br></div><div>Thanks in advance.</div><div><br></div><div><div>> drv <- MySQL</div><div>> drv <- MySQL()</div><div>> drv</div><div><MySQLDriver:(302)> </div><div>> con <- dbConnect(drv, user = "mkao006", password = "test")</div>
<div>Error in mysqlNewConnection(drv, ...) : </div><div> RS-DBI driver: (Failed to connect to database: Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)</div><div>)</div></div></div>
</blockquote><div><br></div><div>Is mysql running? Is it running on the local machine? If so, what happens if you specify the host as "localhost"?</div><div><br></div><div>Sean</div><div><br></div><div><br></div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word"><div><br></div><div><div>> <a href="http://Sys.info" target="_blank">Sys.info</a>()</div>
<div> sysname </div><div> "Darwin" </div>
<div> release </div><div> "10.7.0" </div>
<div> version </div><div>"Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386" </div>
<div> nodename </div><div> "OGL002-8.local" </div>
<div> machine </div><div> "i386" </div>
<div> login </div><div> "michaelkao" </div>
<div> user </div><div> "michaelkao" </div>
</div><div><div>> R.version</div><div> _ </div><div>platform x86_64-apple-darwin9.8.0 </div><div>arch x86_64 </div><div>os darwin9.8.0 </div>
<div>system x86_64, darwin9.8.0 </div><div>status </div><div>major 2 </div><div>minor 13.0 </div><div>
year 2011 </div><div>month 04 </div><div>day 13 </div><div>svn rev 55427 </div><div>language R </div>
<div>version.string R version 2.13.0 (2011-04-13)</div></div><div><br></div><div><div>> sessionInfo()</div><div>R version 2.13.0 (2011-04-13)</div><div>Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)</div><div><br></div>
<div>locale:</div><div>[1] C</div><div><br></div><div>attached base packages:</div><div>[1] grid stats graphics grDevices utils datasets methods </div><div>[8] base </div><div><br></div><div>other attached packages:</div>
<div> [1] RODBC_1.3-2 RMySQL_0.7-5 </div><div> [3] DBI_0.2-5 gdata_2.8.1 </div><div> [5] PerformanceAnalytics_1.0.3.2 quantmod_0.3-15 </div><div>
[7] TTR_0.20-2 xts_0.8-0 </div><div> [9] zoo_1.6-5 Defaults_1.1-1 </div><div>[11] ggplot2_0.8.9 proto_0.3-9.2 </div><div>[13] reshape_0.8.4 plyr_1.5.2 </div>
<div><br></div><div>loaded via a namespace (and not attached):</div><div>[1] digest_0.5.0 gtools_2.6.2 lattice_0.19-26 tools_2.13.0 </div></div><div><br><div>
<div style="word-wrap:break-word"><div><b><font color="#00000000">Michael Kao</font></b></div><div>RedBox Data Analyst</div><div>Data Team</div><div><br></div><div><u><span><span></span><br><span><img height="64" width="85" src="cid:2E826F85-3863-4687-AC74-64459484115C@local"></span><span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><span><span><span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br>
<br><span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div>
<span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-size:12px"><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">
<font face="Verdana" size="1" color="#d7251a" style="color:rgb(215, 37, 26)">Ogilvy New Zealand</font><font face="Verdana" size="1"> | 22 Stanley St Parnell Auckland</font></div></span></span></div></span></span></span></span></span></span>
</span></u></div><u>
</u></div></div><br></div></div></blockquote></div><br>