r-dbi / RMySQL

Legacy DBI interface for MySQL

Home Page:http://cran.r-project.org/package=RMySQL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failure to use ~/.my.cnf beginning with v0.10.14

EricGoldsmith opened this issue · comments

Would appreciate input from those who are wise in the ways of the use of ~/.my.cnf.

Have been using binary distributions of RMySQL on OSX for years, making use of ~/.my.cnf without issue.

Beginning with v0.10.14, DB connections would fail like:

Error in .local(drv, ...) : 
  Failed to connect to database: Error: Access denied for user 'ericgoldsmith'@'10.199.0.56' (using password: NO) 

Took a while to realize that it was no longer using the info from ~/.my.cnf.

I re-installed RMySQL, from source this time (install.packages("RMySQL", type = "source")), having already had mysql installed via homebrew, and all was back to normal.

Same thing happened when RMySQL v0.10.15 was released. Installed from source, and all was good.

In researching this, I came upon this doc, while for MariaDB, discusses the myriad of places config files can live. But, a comment at the bottom says:

Be aware that the paths listed above are compile-time options, and may be different in your version, if you download and built using a package manager. …
In my case, I had installed a Mac OS package from this site for an earlier version, which put everything where expected. Then MariaDB stopped supporting Mac OS binaries, and so I used homebrew to install 10.1.8, which then looked for my.cnf in /usr/local/etc/my.cnf.d/ . I spent HOURS trying to figure out why the variables I changed didn't happen!

I suspect something like this is the root of the original issue - config file location info was changed with the v0.10.14 binary - and installing from source restored prior behavior. But, I can't quite connect all the dots to say that definitively.

Any assistance would be appreciated.

Can you please try the default.file argument to dbConnect() ? Please be sure to use absolute paths and not "~", you can convert with path.expand() .

No change.

I'm having a similar problem. I'm using MacOS 10.12.6, and installed mysql using macports. dbConnect() works when I compile RMySQL from source, but I get a connection error when I install the binary. Including the default.file argument does not help.