Skip to content

host not read from .my.cnf #225

@klopianoRTA

Description

@klopianoRTA

I'm having an issue with the latest version of RMySQL. Specifically it appears that the host parameter in the .my.cnf file is not being read. I know the .my.cnf file is being read to get the user and password.

The following error for the first case below
Error in .local(drv, ...) : Failed to connect to database: Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Note the three cases below. The second case works when I specify the exact same hostname as in the .my.cnf. I have not needed to do this before installing 0.10.16. Is this behavior expected?

library(RMySQL)

  • This does not work
    tmpConn = dbConnect(RMySQL::MySQL(),group="auroraedsl", dbname="schemaname")
  • This does work
    tmpConn = dbConnect(RMySQL::MySQL(),group="groupname", dbname="schemaname", host="hostname")
  • This also works
    tmpConn = dbConnect(RMariaDB::MariaDB(),group="groupname", dbname="schemaname")

Session Info

`R version 3.5.2 (2018-12-20)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.2

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] RMySQL_0.10.16 DBI_1.0.0

loaded via a namespace (and not attached):
[1] bit_1.1-14 compiler_3.5.2 hms_0.4.2 tools_3.5.2
[5] RMariaDB_1.0.6 yaml_2.2.0 Rcpp_1.0.0 bit64_0.9-7
[9] pkgconfig_2.0.2 rlang_0.3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions