Comments (15)
from rmysql.
To be clear - The command above that does not work does work when using version 0.10.15. I was having trouble using install_version to get 0.10.15 installed so I ended up having a colleague send me the RMySQL director from the Library directory on their machine. Manually pasting this in my Library directory allowed me to get back to 0.10.15.
In reading through recent commits to master, my guess is deleting this file may be causing the issue
from rmysql.
I am also having this problem.
Input:
db <- src_mysql(dbname = x, default.file = path.expand("~/myconfig.cnf"), port = 3306, create = F)
Output:
Error in .local(drv, ...) :
Failed to connect to database: Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
This line of code worked Thursday 1/24/2019 and did not work on Friday 1/25/2019 and the only thing I can think of is that I updated some package unwittingly that caused some change. I have tried to install the same configuration as my co-worker who is still able to run this line, but I cannot install RMySQL 0.10.11, the oldest I can install is RMySQL 0.10.14. Older than that I get an installation error:
./RS-MySQL.h:31:10: fatal error: 'mysql_version.h' file not found. I also get in an error during installation that does not prevent installation: can't open config file: /usr/local/etc/openssl/openssl.cnf rmysql.
I am running:
MacOS Mojave 10.14.2
RStudio 1.1.463
R 3.3.3
DBI 0.5-1
dplyr 0.5.0
RMySQL 0.10.14
I have also tried this with
R 3.5
DBI 1.0.0, 1.1.0, 1.2.0
dplyr 0.7.4, 0.7.8
RMySQL 0.10.15, 0.10.16
I tried copying the raw of the mysql-connector-c.rb mentioned above and placing that file into the RMySQL directory but that didn't help.
from rmysql.
I just had this issue myself.
con <- DBI::dbConnect(RMySQL::MySQL(),
default.file = ".my.cnf",
group = "mygroup")
worked perfectly under 3.5.1 but when I upgraded R to 3.5.2, it stopped working! Calling dbConnect() with all the connection credentials as parameters works, so the problem seems to be with PARSING of .my.cnf when DBI and RMySQL are run within 3.5.2
from rmysql.
@dan-reznik Are you using RMySQL 0.10.16? I've had no trouble with 0.10.15 and R 3.5.2
from rmysql.
Yes, I am using 0.10.16. But I've also tried with 0.10.15 and had the same issue.
from rmysql.
i started to use RMariaDB and the issue went away
from rmysql.
I get the same error whether I use RMySQL or RMariaDB:
Failed to connect to database: Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
from rmysql.
try this
con <- DBI::dbConnect(RMariaDB::MariaDB() # RMySQL::MySQL(),
,default.file = "./.my.cnf" # notice the ./
,group = "the group name in your file"
)
from rmysql.
Has anyone had luck resolving this issue for MySQL? Unfortunately, I can't migrate my data to MariaDB.
from rmysql.
Currently the .my.cnf file is in my top directory (~). The format of the file contents are:
# Config file to connect to the remote DB
[client]
username=my_username
password=my_password
host=my.host.connection.edu
So should I try:
con <- DBI::dbConnect(RMariaDB::MariaDB() # RMySQL::MySQL(),
,default.file = "~/.my.cnf" # notice the ./
,group = "the group name in your file"
)
and would the group name be "client"?
Or should I move my file to the working directory of my repo?
from rmysql.
@mstuart1 yes,group name is "client", but suggest change the name to avoid some possible troubles.
from rmysql.
con <- DBI::dbConnect(RMySQL::MySQL(), default.file="~/my.cnf", group="client")
I'm still getting an error for this:
Error in .local(drv, ...) :
Failed to connect to database: Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
In addition: Warning message:
In .local(drv, ...) : partial argument match of 'group' to 'groups'
from rmysql.
Figured out that I can use rstudioapi to request password. Except it doesn't work with package testing or Rmarkdown knitting :/
from rmysql.
I'm also trying to deal with this issue, and can't migrate to MariaDB due to it currently not handling JSON columns. Interestingly, RMySql successfully handles the .my.cnf in my development environment (Debian GNU/Linux 9 (stretch)), but it's failing in the Rstudio Connect server I'm trying to publish to ( Ubuntu 18.04.3 LTS)
- Session Info for Publishing Environment where failures are occurring:
R version 3.6.0 (2019-04-26)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.3 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1
locale:
[1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8
[4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8
[7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] DBI_1.0.0.9003
loaded via a namespace (and not attached):
[1] compiler_3.6.0 RMySQL_0.10.17
- Dev Session Info (No errors):
R version 3.6.0 (2019-04-26)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.3 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=C
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] DBI_1.0.0.9003
loaded via a namespace (and not attached):
[1] compiler_3.6.0 RMySQL_0.10.17
from rmysql.
Related Issues (20)
- SSL CA fails HOT 1
- Error when installing RMysql on RHEL 7.3 HOT 3
- Query table of many DECIMAL columns causes error in terminal HOT 5
- RMysql encoding utf8 issue
- mysqlHasDefault() broken on Linux? HOT 1
- SSL - check status HOT 1
- Date datetype is written as text
- Document default database name in the RMySQL::mysqlHasDefault() function
- dbWriteTable fails without row_names column HOT 1
- Installing with Homebrew on OS X Sierra; cannot find RMySQL.so file it just created?
- Implement RStudio Connection Contract HOT 1
- Rows missing on inserting data frame with large character field
- RMySQL fails build with mariadb >10.4 HOT 12
- GenomicFeatures and RMySQL HOT 4
- Cannot connect to MySQL 8.0.11 HOT 3
- Can't install
- Failure to use ~/.my.cnf beginning with v0.10.14 HOT 3
- Unable to install RMySQL on macOS 10.13.6 HOT 7
- connecting using SSL (client.flag=2048) to a RDS DB freezes forever HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rmysql.