[R-sig-DB] Fail to Connect to Mysql

Sean Davis @d@v|@2 @end|ng |rom m@||@n|h@gov
Thu Jun 16 01:32:31 CEST 2011


On Wed, Jun 15, 2011 at 6:59 PM, Michael Kao <michael.kao using ogilvy.co.nz>wrote:

> Hi guys,
>
> 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.
>
> Thanks in advance.
>
> > drv <- MySQL
> > drv <- MySQL()
> > drv
> <MySQLDriver:(302)>
> > con <- dbConnect(drv, user = "mkao006", password = "test")
> Error in mysqlNewConnection(drv, ...) :
>   RS-DBI driver: (Failed to connect to database: Error: Can't connect to
> local MySQL server through socket '/tmp/mysql.sock' (2)
> )
>

Is mysql running?  Is it running on the local machine?  If so, what happens
if you specify the host as "localhost"?

Sean




>
> > Sys.info()
>
>              sysname
>
>             "Darwin"
>
>              release
>
>             "10.7.0"
>
>              version
> "Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011;
> root:xnu-1504.9.37~1/RELEASE_I386"
>
>             nodename
>
>     "OGL002-8.local"
>
>              machine
>
>               "i386"
>
>                login
>
>         "michaelkao"
>
>                 user
>
>         "michaelkao"
> > R.version
>                _
> platform       x86_64-apple-darwin9.8.0
> arch           x86_64
> os             darwin9.8.0
> system         x86_64, darwin9.8.0
> status
> major          2
> minor          13.0
> year           2011
> month          04
> day            13
> svn rev        55427
> language       R
> version.string R version 2.13.0 (2011-04-13)
>
> > sessionInfo()
> R version 2.13.0 (2011-04-13)
> Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
>
> locale:
> [1] C
>
> attached base packages:
> [1] grid      stats     graphics  grDevices utils     datasets  methods
> [8] base
>
> other attached packages:
>  [1] RODBC_1.3-2                  RMySQL_0.7-5
>  [3] DBI_0.2-5                    gdata_2.8.1
>  [5] PerformanceAnalytics_1.0.3.2 quantmod_0.3-15
>  [7] TTR_0.20-2                   xts_0.8-0
>  [9] zoo_1.6-5                    Defaults_1.1-1
> [11] ggplot2_0.8.9                proto_0.3-9.2
> [13] reshape_0.8.4                plyr_1.5.2
>
> loaded via a namespace (and not attached):
> [1] digest_0.5.0    gtools_2.6.2    lattice_0.19-26 tools_2.13.0
>
> *Michael Kao*
> RedBox Data Analyst
> Data Team
>
> *
>
>
> Ogilvy New Zealand | 22 Stanley St  Parnell  Auckland
> *
> * *
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-db/attachments/20110615/d1b2c273/attachment.html>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: unknown.jpg
Type: image/jpeg
Size: 2929 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-db/attachments/20110615/d1b2c273/attachment.jpg>


More information about the R-sig-DB mailing list