<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">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><br></div><div><div>> <a href="http://Sys.info">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 apple-content-edited="true">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><b><font class="Apple-style-span" color="#00000000">Michael Kao</font></b></div><div>RedBox Data Analyst</div><div>Data Team</div><div><br></div><div><u><span class="Apple-style-span" style="-webkit-text-decorations-in-effect: none; "><span></span><br class="Apple-interchange-newline"><span><img height="64" width="85" id="36782697-7ac9-4713-b95a-b13c98fbc211" apple-width="yes" apple-height="yes" src="cid:2E826F85-3863-4687-AC74-64459484115C@local"></span><span class="Apple-style-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; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="-webkit-text-decorations-in-effect: underline; "><span class="Apple-style-span" style="-webkit-text-decorations-in-effect: none; "><span class="Apple-style-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; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-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; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><br class="Apple-interchange-newline"><br><span class="Apple-style-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; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div><span class="Apple-style-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; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-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="font: normal normal normal 9px/normal Verdana; color: rgb(215, 37, 26); ">Ogilvy New Zealand</font><font face="Verdana" size="1" style="font: normal normal normal 9px/normal Verdana; "> | 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></body></html>