{"id":19551391,"url":"https://github.com/r-dbi/rmysql","last_synced_at":"2025-05-16T05:06:52.689Z","repository":{"id":2214676,"uuid":"3164089","full_name":"r-dbi/RMySQL","owner":"r-dbi","description":"Legacy DBI interface for MySQL","archived":false,"fork":false,"pushed_at":"2025-04-01T13:02:23.000Z","size":9581,"stargazers_count":209,"open_issues_count":48,"forks_count":107,"subscribers_count":34,"default_branch":"main","last_synced_at":"2025-05-15T08:24:22.898Z","etag":null,"topics":["database","mysql","r"],"latest_commit_sha":null,"homepage":"http://cran.r-project.org/package=RMySQL","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/r-dbi.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2012-01-12T17:27:03.000Z","updated_at":"2025-04-01T13:02:27.000Z","dependencies_parsed_at":"2023-01-11T16:08:38.337Z","dependency_job_id":"b35e3ce0-c372-48a9-b198-a45d155de2f5","html_url":"https://github.com/r-dbi/RMySQL","commit_stats":{"total_commits":401,"total_committers":18,"mean_commits":22.27777777777778,"dds":0.5261845386533666,"last_synced_commit":"989014c5e8a5768fb5bd5b61a1790b377aab2123"},"previous_names":["rstats-db/rmysql"],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-dbi%2FRMySQL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-dbi%2FRMySQL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-dbi%2FRMySQL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-dbi%2FRMySQL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r-dbi","download_url":"https://codeload.github.com/r-dbi/RMySQL/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254471061,"owners_count":22076585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","mysql","r"],"created_at":"2024-11-11T04:13:43.858Z","updated_at":"2025-05-16T05:06:47.680Z","avatar_url":"https://github.com/r-dbi.png","language":"C","readme":"RMySQL\n======\n\nNOTE: this package is being phased out in favor of the new [RMariaDB](https://github.com/r-dbi/RMariaDB) package.\n\n\u003e Database Interface and MySQL Driver for R\n\n[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/r-dbi/RMySQL?svg=true)](https://ci.appveyor.com/project/jeroen/RMySQL)\n[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/RMySQL)](https://cran.r-project.org/package=RMySQL)\n[![CRAN RStudio mirror downloads](http://cranlogs.r-pkg.org/badges/RMySQL)](https://cran.r-project.org/package=RMySQL)\n\nRMySQL is a database interface and MySQL driver for R. This version complies with the database interface definition as implemented in the package DBI 0.2-2. \n\n## Hello World\n\n```R\nlibrary(DBI)\n# Connect to my-db as defined in ~/.my.cnf\ncon \u003c- dbConnect(RMySQL::MySQL(), group = \"my-db\")\n\ndbListTables(con)\ndbWriteTable(con, \"mtcars\", mtcars)\ndbListTables(con)\n\ndbListFields(con, \"mtcars\")\ndbReadTable(con, \"mtcars\")\n\n# You can fetch all results:\nres \u003c- dbSendQuery(con, \"SELECT * FROM mtcars WHERE cyl = 4\")\ndbFetch(res)\ndbClearResult(res)\n\n# Or a chunk at a time\nres \u003c- dbSendQuery(con, \"SELECT * FROM mtcars WHERE cyl = 4\")\nwhile(!dbHasCompleted(res)){\n  chunk \u003c- dbFetch(res, n = 5)\n  print(nrow(chunk))\n}\n# Clear the result\ndbClearResult(res)\n\n# Disconnect from the database\ndbDisconnect(con)\n```\n\n## Installation\n\nBinary packages for __OS-X__ or __Windows__ can be installed directly from CRAN:\n\n```r\ninstall.packages(\"RMySQL\")\n```\n\nThe development version from github:\n\n```R\n# install.packages(\"devtools\")\ndevtools::install_github(\"r-dbi/DBI\")\ndevtools::install_github(\"r-dbi/RMySQL\")\n```\n\nInstallation from source on Linux or OSX requires [`MariaDB Connector/C`](https://downloads.mariadb.org/connector-c/). On some older platforms you can also link against Oracle's [libmysqlclient](https://packages.debian.org/testing/libmysqlclient-dev) driver but the mariadb implementation is much better.\n\nOn recent __Debian or Ubuntu__ install [libmariadbclient-dev](https://packages.debian.org/testing/libmariadbclient-dev)\n```\nsudo apt-get install -y libmariadbclient-dev\n```\n\nOn __Fedora__,  __CentOS or RHEL__ we need [mariadb-devel](https://src.fedoraproject.org/rpms/mariadb):\n\n```\nsudo yum install mariadb-devel\n````\n\nOn __OS-X__ use [mariadb-connector-c](https://github.com/Homebrew/homebrew-core/blob/master/Formula/mariadb-connector-c.rb) from Homebrew:\n\n```\nbrew install mariadb-connector-c\n```\n\n\n## MySQL configuration file\n\nInstead of specifying a username and password in calls to `dbConnect()`, it's better to set up a MySQL configuration file that names the databases that you connect to most commonly. This file should live in `~/.my.cnf` and look like:\n\n```\n[database_name]\noption1=value1\noption2=value2\n```\n\nIf you want to run the examples, you'll need to set the proper options in the `[rs-dbi]` group of any MySQL option file, such as /etc/my.cnf or the .my.cnf file in your home directory. For a default single user install of MySQL, the following code should work:\n\n```\n[rs-dbi]\ndatabase=test\nuser=root\npassword=\n```\n\n## Acknowledgements\n\nMany thanks to Christoph M. Friedrich, John Heuer, Kurt Hornik, Torsten Hothorn, Saikat Debroy, Matthew Kelly, Brian D. Ripley, Mikhail Kondrin, Jake Luciani, Jens Nieschulze, Deepayan Sarkar, Louis Springer, Duncan Temple Lang, Luis Torgo, Arend P. van der Veen, Felix Weninger, J. T. Lindgren, Crespin Miller, and Michal Okonlewski, Seth Falcon and Paul Gilbert for comments, suggestions, bug reports, and patches.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-dbi%2Frmysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr-dbi%2Frmysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-dbi%2Frmysql/lists"}