All Projects → r-dbi → Rmysql

r-dbi / Rmysql

Legacy DBI interface for MySQL

Programming Languages

c
50402 projects - #5 most used programming language
r
7636 projects

Projects that are alternatives of or similar to Rmysql

Pomelo.entityframeworkcore.mysql
Entity Framework Core provider for MySQL and MariaDB built on top of MySqlConnector
Stars: ✭ 2,099 (+993.23%)
Mutual labels:  database, mysql
Linq2db
Linq to database provider.
Stars: ✭ 2,211 (+1051.56%)
Mutual labels:  database, mysql
Ohmysql
Easy direct access to your database 🎯 http://oleghnidets.github.io/OHMySQL/
Stars: ✭ 166 (-13.54%)
Mutual labels:  database, mysql
Quizbook
An android app with google material design to play quizzes in different categories.
Stars: ✭ 156 (-18.75%)
Mutual labels:  database, mysql
Nut
Advanced, Powerful and easy to use ORM for Qt
Stars: ✭ 181 (-5.73%)
Mutual labels:  database, mysql
Database To Plantuml
Compile PostgreSQL and MySQL table information into a PlantUML description.
Stars: ✭ 157 (-18.23%)
Mutual labels:  database, mysql
Enumdb
Relational database brute force and post exploitation tool for MySQL and MSSQL
Stars: ✭ 167 (-13.02%)
Mutual labels:  database, mysql
Grimoire
Database access layer for golang
Stars: ✭ 151 (-21.35%)
Mutual labels:  database, mysql
Scalardb
Universal transaction manager
Stars: ✭ 178 (-7.29%)
Mutual labels:  database, mysql
Space Cloud
Open source Firebase + Heroku to develop, scale and secure serverless apps on Kubernetes
Stars: ✭ 3,323 (+1630.73%)
Mutual labels:  database, mysql
Quill
Compile-time Language Integrated Queries for Scala
Stars: ✭ 1,998 (+940.63%)
Mutual labels:  database, mysql
Simple Crud
PHP library to provide magic CRUD in MySQL/Sqlite databases with zero configuration
Stars: ✭ 190 (-1.04%)
Mutual labels:  database, mysql
Myproxy
A sharding proxy for MYSQL databases
Stars: ✭ 153 (-20.31%)
Mutual labels:  database, mysql
Condenser
Condenser is a database subsetting tool
Stars: ✭ 189 (-1.56%)
Mutual labels:  database, mysql
Slimdump
A tool for creating configurable dumps of large MySQL-databases.
Stars: ✭ 151 (-21.35%)
Mutual labels:  database, mysql
Sqlcheck
Automatically identify anti-patterns in SQL queries
Stars: ✭ 2,062 (+973.96%)
Mutual labels:  database, mysql
Polluter
The easiest solution to seed database with Go
Stars: ✭ 146 (-23.96%)
Mutual labels:  database, mysql
Querybuilder
SQL query builder, written in c#, helps you build complex queries easily, supports SqlServer, MySql, PostgreSql, Oracle, Sqlite and Firebird
Stars: ✭ 2,111 (+999.48%)
Mutual labels:  database, mysql
Ctlstore
Control Data Store
Stars: ✭ 171 (-10.94%)
Mutual labels:  database, mysql
Stackoverflow Clone
Clone project of a famous Q/A website for developers which is stackoverflow built using MySQL-Express-React-Node 🌐
Stars: ✭ 182 (-5.21%)
Mutual labels:  database, mysql

RMySQL

NOTE: this package is being phased out in favor of the new RMariaDB package.

Database Interface and MySQL Driver for R

Build Status AppVeyor Build Status CRAN_Status_Badge CRAN RStudio mirror downloads Coverage Status

RMySQL 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.

Hello World

library(DBI)
# Connect to my-db as defined in ~/.my.cnf
con <- dbConnect(RMySQL::MySQL(), group = "my-db")

dbListTables(con)
dbWriteTable(con, "mtcars", mtcars)
dbListTables(con)

dbListFields(con, "mtcars")
dbReadTable(con, "mtcars")

# You can fetch all results:
res <- dbSendQuery(con, "SELECT * FROM mtcars WHERE cyl = 4")
dbFetch(res)
dbClearResult(res)

# Or a chunk at a time
res <- dbSendQuery(con, "SELECT * FROM mtcars WHERE cyl = 4")
while(!dbHasCompleted(res)){
  chunk <- dbFetch(res, n = 5)
  print(nrow(chunk))
}
# Clear the result
dbClearResult(res)

# Disconnect from the database
dbDisconnect(con)

Installation

Binary packages for OS-X or Windows can be installed directly from CRAN:

install.packages("RMySQL")

The development version from github:

# install.packages("devtools")
devtools::install_github("r-dbi/DBI")
devtools::install_github("r-dbi/RMySQL")

Installation from source on Linux or OSX requires MariaDB Connector/C. On some older platforms you can also link against Oracle's libmysqlclient driver but the mariadb implementation is much better.

On recent Debian or Ubuntu install libmariadbclient-dev

sudo apt-get install -y libmariadbclient-dev

On Fedora, CentOS or RHEL we need mariadb-devel:

sudo yum install mariadb-devel

On OS-X use mariadb-connector-c from Homebrew:

brew install mariadb-connector-c

MySQL configuration file

Instead 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:

[database_name]
option1=value1
option2=value2

If 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:

[rs-dbi]
database=test
user=root
password=

Acknowledgements

Many 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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].