3

I am trying to connect to MariaDB server running on Amazon RDS platform using the RMySQL package. Till few days back it was running fine, until I updated my packages to the latest version. Now trying to connect to the DB throws this error:

Error: Lost connection to MySQL server at 'reading authorization packet', system error: 0

Things that I have tried: reverting to previous versions of R, RMySQL & DBI; replaced the host name with ip-address and the connect_timeout = 10 seconds.

>sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.2 LTS

Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.6.0
LAPACK: /usr/lib/lapack/liblapack.so.3.6.0

locale:
[1] LC_CTYPE=en_IN.UTF-8       LC_NUMERIC=C               
LC_TIME=en_IN.UTF-8        LC_COLLATE=en_IN.UTF-8    
[5] LC_MONETARY=en_IN.UTF-8    LC_MESSAGES=en_IN.UTF-8    
LC_PAPER=en_IN.UTF-8       LC_NAME=C                 
[9] LC_ADDRESS=C               LC_TELEPHONE=C             
LC_MEASUREMENT=en_IN.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
[1] arules_1.5-2      data.table_1.10.4 bit64_0.9-7       bit_1.1-12        
magrittr_1.5      NbClust_3.0      
[7] stringr_1.2.0     RMySQL_0.10.11    DBI_0.6-1         rjson_0.2.15      
dplyr_0.5.0       Matrix_1.2-10    

loaded via a namespace (and not attached):
[1] Rcpp_0.12.11     lattice_0.20-35  assertthat_0.2.0 grid_3.4.0       
R6_2.2.1         rlang_0.1.1     
[7] stringi_1.1.5    lazyeval_0.2.0   tools_3.4.0      compiler_3.4.0   
tibble_1.3.3

However, I am able to run queries using the same settings on the local MySQL setup.

tushaR
  • 3,083
  • 1
  • 20
  • 33

1 Answers1

0

I was able to fix this issue on my PC using R 3.4 by following @Page's advice to look into the package versioning. However, not only did I need to install an earlier version of RMySQL (reverting from 0.10.11 to 0.10.9), I also needed to change versions on its dependancy package DBI (reverting from 0.6-1 to 0.5), using the following command:

require(devtools)
install_version("DBI", version = "0.5", repos = "http://cran.us.r-project.org")
install_version("RMySQL", version = "0.10.9", repos = "http://cran.us.r-project.org")
jFrostad
  • 85
  • 1
  • 6
  • I tried this, but it is not working for me. Still throwing an error: `Error: Lost connection to MySQL server at 'reading authorization packet', system error: 2` – tushaR Jun 16 '17 at 04:24