“读取授权包”丢失了与MySQL服务器的连接,系统错误:0,Amazon RDS

时间:2017-06-15 06:10:45

标签: r amazon-rds rmysql

我正在尝试使用RMySQL包连接到在Amazon RDS平台上运行的MariaDB服务器。几天前,它运行正常,直到我将我的软件包更新到最新版本。现在尝试连接到数据库会抛出此错误:

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

我尝试过的事情: 恢复到以前版本的R,RMySQL& DBI;用ip-address替换主机名,connect_timeout = 10秒。

>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

但是,我能够在本地MySQL设置上使用相同的设置运行查询。

1 个答案:

答案 0 :(得分:0)

我可以通过跟随@Page's advice查看软件包版本来使用R 3.4在我的电脑上修复此问题。但是,我不仅需要安装早期版本的RMySQL(从0.10.11恢复到0.10.9),我还需要更改其依赖包DBI上的版本(从0.6-1恢复到0.5),使用以下命令:

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")