cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Error in library(RMySQL): there is no package called ‘RMySQL’

kaileena
New Contributor

i tried to install RMySQL on databricks like this:

install.packages("RMySQL")

i got this error:

Installing package into ‘/local_disk0/.ephemeral_nfs/envs/rEnv-c677bc4c-e6a3-40df-a5ab-bfd5d277e0c0’ (as ‘lib’ is unspecified) Warning: unable to access index for repository https://cloud.r-project.org/src/contrib: cannot open URL 'https://cloud.r-project.org/src/contrib/PACKAGES' trying URL 'https://cran.microsoft.com/src/contrib/shinydashboard_0.7.2.tar.gz' Content type 'application/octet-stream' length 239254 bytes (233 KB) ================================================== downloaded 233 KB The downloaded source packages are in ‘/tmp/Rtmp4ZFosL/downloaded_packages’ Installing package into ‘/local_disk0/.ephemeral_nfs/envs/rEnv-c677bc4c-e6a3-40df-a5ab-bfd5d277e0c0’ (as ‘lib’ is unspecified) Warning: unable to access index for repository https://cloud.r-project.org/src/contrib: cannot open URL 'https://cloud.r-project.org/src/contrib/PACKAGES' also installing the dependencies ‘lazyeval’, ‘crosstalk’ trying URL 'https://cran.microsoft.com/src/contrib/lazyeval_0.2.2.tar.gz' Content type 'application/octet-stream' length 83482 bytes (81 KB) ================================================== downloaded 81 KB trying URL 'https://cran.microsoft.com/src/contrib/crosstalk_1.2.0.tar.gz' Content type 'application/octet-stream' length 296495 bytes (289 KB) ================================================== downloaded 289 KB trying URL 'https://cran.microsoft.com/src/contrib/DT_0.27.tar.gz' Content type 'application/octet-stream' length 1498173 bytes (1.4 MB) ================================================== downloaded 1.4 MB The downloaded source packages are in ‘/tmp/Rtmp4ZFosL/downloaded_packages’ Installing package into ‘/local_disk0/.ephemeral_nfs/envs/rEnv-c677bc4c-e6a3-40df-a5ab-bfd5d277e0c0’ (as ‘lib’ is unspecified) Warning: unable to access index for repository https://cloud.r-project.org/src/contrib: cannot open URL 'https://cloud.r-project.org/src/contrib/PACKAGES' trying URL 'https://cran.microsoft.com/src/contrib/shinythemes_1.2.0.tar.gz' Content type 'application/octet-stream' length 972144 bytes (949 KB) ================================================== downloaded 949 KB The downloaded source packages are in ‘/tmp/Rtmp4ZFosL/downloaded_packages’ Installing package into ‘/local_disk0/.ephemeral_nfs/envs/rEnv-c677bc4c-e6a3-40df-a5ab-bfd5d277e0c0’ (as ‘lib’ is unspecified) Warning: unable to access index for repository https://cloud.r-project.org/src/contrib: cannot open URL 'https://cloud.r-project.org/src/contrib/PACKAGES' trying URL 'https://cran.microsoft.com/src/contrib/reshape_0.8.9.tar.gz' Content type 'application/octet-stream' length 41843 bytes (40 KB) ================================================== downloaded 40 KB The downloaded source packages are in ‘/tmp/Rtmp4ZFosL/downloaded_packages’ Installing package into ‘/local_disk0/.ephemeral_nfs/envs/rEnv-c677bc4c-e6a3-40df-a5ab-bfd5d277e0c0’ (as ‘lib’ is unspecified) Warning: unable to access index for repository https://cloud.r-project.org/src/contrib: cannot open URL 'https://cloud.r-project.org/src/contrib/PACKAGES' also installing the dependency ‘reactR’ trying URL 'https://cran.microsoft.com/src/contrib/reactR_0.4.4.tar.gz' Content type 'application/octet-stream' length 714589 bytes (697 KB) ================================================== downloaded 697 KB trying URL 'https://cran.microsoft.com/src/contrib/reactable_0.4.3.tar.gz' Content type 'application/octet-stream' length 982963 bytes (959 KB) ================================================== downloaded 959 KB The downloaded source packages are in ‘/tmp/Rtmp4ZFosL/downloaded_packages’ Installing package into ‘/local_disk0/.ephemeral_nfs/envs/rEnv-c677bc4c-e6a3-40df-a5ab-bfd5d277e0c0’ (as ‘lib’ is unspecified) Warning: unable to access index for repository https://cloud.r-project.org/src/contrib: cannot open URL 'https://cloud.r-project.org/src/contrib/PACKAGES' also installing the dependencies ‘XML’, ‘TTR’, ‘rlist’, ‘zoo’, ‘xts’, ‘quantmod’, ‘igraph’, ‘rjson’ trying URL 'https://cran.microsoft.com/src/contrib/XML_3.99-0.13.tar.gz' Content type 'application/octet-stream' length 970757 bytes (948 KB) ================================================== downloaded 948 KB trying URL 'https://cran.microsoft.com/src/contrib/TTR_0.24.3.tar.gz' Content type 'application/octet-stream' length 317338 bytes (309 KB) ================================================== downloaded 309 KB trying URL 'https://cran.microsoft.com/src/contrib/rlist_0.4.6.2.tar.gz' Content type 'application/octet-stream' length 72870 bytes (71 KB) ================================================== downloaded 71 KB trying URL 'https://cran.microsoft.com/src/contrib/zoo_1.8-11.tar.gz' Content type 'application/octet-stream' length 781934 bytes (763 KB) ================================================== downloaded 763 KB trying URL 'https://cran.microsoft.com/src/contrib/xts_0.13.0.tar.gz' Content type 'application/octet-stream' length 453032 bytes (442 KB) ================================================== downloaded 442 KB trying URL 'https://cran.microsoft.com/src/contrib/quantmod_0.4.20.tar.gz' Content type 'application/octet-stream' length 156640 bytes (152 KB) ================================================== downloaded 152 KB trying URL 'https://cran.microsoft.com/src/contrib/igraph_1.4.1.tar.gz' Content type 'application/octet-stream' length 2910158 bytes (2.8 MB) ================================================== downloaded 2.8 MB trying URL 'https://cran.microsoft.com/src/contrib/rjson_0.2.21.tar.gz' Content type 'application/octet-stream' length 116509 bytes (113 KB) ================================================== downloaded 113 KB trying URL 'https://cran.microsoft.com/src/contrib/highcharter_0.9.4.tar.gz' Content type 'application/octet-stream' length 1073325 bytes (1.0 MB) ================================================== downloaded 1.0 MB The downloaded source packages are in ‘/tmp/Rtmp4ZFosL/downloaded_packages’ Installing package into ‘/local_disk0/.ephemeral_nfs/envs/rEnv-c677bc4c-e6a3-40df-a5ab-bfd5d277e0c0’ (as ‘lib’ is unspecified) Warning: unable to access index for repository https://cloud.r-project.org/src/contrib: cannot open URL 'https://cloud.r-project.org/src/contrib/PACKAGES' trying URL 'https://cran.microsoft.com/src/contrib/priceR_0.1.67.tar.gz' Content type 'application/octet-stream' length 74790 bytes (73 KB) ================================================== downloaded 73 KB The downloaded source packages are in ‘/tmp/Rtmp4ZFosL/downloaded_packages’ Installing package into ‘/local_disk0/.ephemeral_nfs/envs/rEnv-c677bc4c-e6a3-40df-a5ab-bfd5d277e0c0’ (as ‘lib’ is unspecified) Warning: unable to access index for repository https://cloud.r-project.org/src/contrib: cannot open URL 'https://cloud.r-project.org/src/contrib/PACKAGES' trying URL 'https://cran.microsoft.com/src/contrib/pool_1.0.1.tar.gz' Content type 'application/octet-stream' length 39744 bytes (38 KB) ================================================== downloaded 38 KB The downloaded source packages are in ‘/tmp/Rtmp4ZFosL/downloaded_packages’ Installing package into ‘/local_disk0/.ephemeral_nfs/envs/rEnv-c677bc4c-e6a3-40df-a5ab-bfd5d277e0c0’ (as ‘lib’ is unspecified) Warning: unable to access index for repository https://cloud.r-project.org/src/contrib: cannot open URL 'https://cloud.r-project.org/src/contrib/PACKAGES' trying URL 'https://cran.microsoft.com/src/contrib/RODBC_1.3-20.tar.gz' Content type 'application/octet-stream' length 929898 bytes (908 KB) ================================================== downloaded 908 KB The downloaded source packages are in ‘/tmp/Rtmp4ZFosL/downloaded_packages’ Installing package into ‘/local_disk0/.ephemeral_nfs/envs/rEnv-c677bc4c-e6a3-40df-a5ab-bfd5d277e0c0’ (as ‘lib’ is unspecified) Warning: unable to access index for repository https://cloud.r-project.org/src/contrib: cannot open URL 'https://cloud.r-project.org/src/contrib/PACKAGES' trying URL 'https://cran.microsoft.com/src/contrib/RMySQL_0.10.25.tar.gz' Content type 'application/octet-stream' length 53316 bytes (52 KB) ================================================== downloaded 52 KB Warning in utils::install.packages(pkgs, ...) : installation of package ‘RMySQL’ had non-zero exit status The downloaded source packages are in ‘/tmp/Rtmp4ZFosL/downloaded_packages’ Using libcurl 7.68.0 with GnuTLS/3.6.13 Attaching package: ‘shinydashboard’ The following object is masked from ‘package:graphics’: box Attaching package: ‘DT’ The following objects are masked from ‘package:shiny’: dataTableOutput, renderDataTable Attaching package: ‘dplyr’
<more code>
 The following object is masked from ‘package:shiny’: getDefaultReactiveDomain Attaching package: ‘scales’ The following object is masked from ‘package:purrr’: discard Attaching package: ‘dbplyr’ The following objects are masked from ‘package:dplyr’: ident, sql
Error in library(RMySQL) : there is no package called ‘RMySQL’
Error in library(RMySQL): there is no package called ‘RMySQL’

2 REPLIES 2

Anonymous
Not applicable

@miru miro​ :

It seems like there were some warnings when trying to install the RMySQL package on Databricks, and the package was not installed.

The warnings suggest that there were issues accessing the repository from which the packages were being downloaded. Specifically, the following warning indicates that there was an issue accessing the PACKAGES index file:

Warning: unable to access index for repository https://cloud.r-project.org/src/contrib: cannot open URL 'https://cloud.r-project.org/src/contrib/PACKAGES' 

This might be due to a network issue or a misconfiguration of the repository URL.

To troubleshoot this issue, you can try the following steps:

  1. Check your internet connection and make sure it is stable.
  2. Verify that the repository URL is correct and that it is accessible from your location.
  3. Try adding another repository URL to your R configuration. You can do this by adding the following line of code to your script before installing the package:
options(repos = c(CRAN = "https://cran.rstudio.com/"))

This will set the CRAN repository as the default repository for package installations. You can replace the URL with another CRAN mirror if you prefer.

4. If none of the above steps work, you can try installing the package manually by downloading the source files and installing them locally. You can find the source files for the RMySQL package on CRAN: https://cran.r-project.org/package=RMySQL. To install the package, download the source file and then run the following command, replacing path/to/file.tar.gz with the path to the downloaded file:

install.packages("path/to/file.tar.gz", repos = NULL, type = "source")

This will install the package from the local source file.

Anonymous
Not applicable

Hi @miru miro​ 

Thank you for posting your question in our community! We are happy to assist you.

To help us provide you with the most accurate information, could you please take a moment to review the responses and select the one that best answers your question?

This will also help other community members who may have similar questions in the future. Thank you for your participation and let us know if you need any further assistance! 

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group