Questions tagged [rmysql]

An R package for interfacing with MySQL and MariaDB databases.

RMySQL is an package providing an interface to and databases. RMySQL uses the interface which is also used by the packages , , , and .

Repositories

Other resources

Related tags

418 questions
8
votes
1 answer

RMySQL: Closing a connection without a handle

I am experimenting with RMySQL, and have accidentally created a connection without a handle. dbConnect(MySQL(), user = "foo", password = "bar") connLocalDB = dbConnect(MySQL(), user = "foo", password = "bar") Note that the return of the first call…
tchakravarty
  • 10,736
  • 12
  • 72
  • 116
8
votes
2 answers

Insert in RMySQL from data frame

Im trying to add data to MySQL table by using RMySQL. I only need to add one row at a time and it's not working. What I'm trying to do is this. dbGetQuery(con,"INSERT INTO names VALUES(data[1,1], data[1,2])") so what I'm doing is that I have values…
TheLaama
  • 307
  • 2
  • 4
  • 12
8
votes
7 answers

How to Connect R with MySQL or how to install RMySQL package?

I am new in R and i am trying to connect R with MySQL. I have installed mysql-5.5.22-winx64 and R-2.12.0 for 64 bit. I have already set MYSQL_HOME environment path(C:\Program Files\MySQL\MySQL Server 5.5) and trying to follow these steps: Install…
Sharad
  • 3,562
  • 6
  • 37
  • 59
7
votes
1 answer

How can I allow rapache/brew to securely connect to a MySQL database?

I'm developing a web application using rapache and brew. Within the R code, I want to use the RMySQL package to query a MySQL database, but I am questioning the best way to access the login details for the database from within the R…
kmm
  • 6,045
  • 7
  • 43
  • 53
7
votes
2 answers

No database selected with RMySQL

I'm trying to connect to remote publicly-accessible MySQL server EnsEMBL public server using RMySQL, but when I try to list the tables, an error occurs: library(RMySQL) mydb = dbConnect(MySQL(), user = 'anonymous', …
jakub
  • 4,774
  • 4
  • 29
  • 46
7
votes
3 answers

How to prevent RMySQL warnings "Unsigned INTEGER in col imported as numeric"?

When loading data from a MySQL table there are often warnings such as : unrecognized MySQL field type 7 in column 26 imported as character Unsigned INTEGER in col 3 imported as numeric How can I correctly load the database table into a dataframe…
Paul Rougieux
  • 10,289
  • 4
  • 68
  • 110
7
votes
2 answers

How to change dplyr::tbl connection encoding to utf8?

In a MySQL database, a table is encoded in utf8, but for some reason the connection is in latin1. res <- RMySQL::dbSendQuery(con,"show variables like 'character_set_%'") dbFetch(res) Variable_name Value 1 …
Paul Rougieux
  • 10,289
  • 4
  • 68
  • 110
7
votes
5 answers

Error installing RMySQL

It took a good amount of time to install RMySQL on my Linux machine but I was able to install it after changing environment variables and copy and paste lib.dll file. However, I'm now trying to install RMySQL on my 64bit window machine, but so far…
user1486507
  • 699
  • 2
  • 13
  • 24
7
votes
1 answer

secure auth error connecting to SQL server from RMySQL

I m trying to connect to a MySQL server on a VM from RMySQL, here are the commands i executed c<-dbConnect(MySQL(), user="root", password="passw0rd", dbname="leopard", host="one-1368") It is showing the following error RS-DBI driver: (Failed to…
m_amber
  • 747
  • 3
  • 13
  • 23
6
votes
5 answers

Error: R cannot connect to MySQL

I updated MySQL to latest version 8.0.11 yesterday and tried to use RMySQL to connect to MySQL, but it was not working and I could not find any solution. My code: library(RMySQL) con <- dbConnect(MySQL(), user="hello", password="hi", dbname =…
Lara19
  • 615
  • 1
  • 9
  • 20
6
votes
3 answers

How to insert a vector into a column of a table in mysql?

In R, I have a vector, "myVector", of strings which I want to insert into a column, "myColumn", of a mysql table, "myTable". I understand I can write the sql query and run it in R using dbSendQuery. So let's figure out the sql query first. Here is…
Mohammad
  • 1,078
  • 2
  • 18
  • 39
6
votes
1 answer

SSH to connect to MySQL Database in R

I want to use the RMySQL package to query a database. I usually type ssh website.com in my mac terminal before using dbConnect() and dbGetQuery() in a R script. My database is behind a firewall and only accessible locally and to the best of my…
Joseph Noirre
  • 387
  • 4
  • 20
6
votes
2 answers

How to insert reactive input values from a shiny app into a MySQL database?

I created an online experiment with the shiny package for R. Let's say I have 3 reactive values called "toss", "decision" and "rating". Additionally, I launched a MySQL database on Amazon web service RDS. The version is MySQL 5.6.22. I…
schindst
  • 71
  • 1
  • 6
6
votes
1 answer

Insert an R data.frame into a mysql table in the mysql REPLACE fashion

(Sorry if this is very basic, I'm just not able to figure out) I have a table t sitting in a mysql db, which looks like this: (Name is the primary key) Current Table in DB Name Balance Bob 100 Ted 150 Carl 130 I also have a…
user997943
  • 303
  • 1
  • 5
  • 12
6
votes
3 answers

LAST_INSERT_ID() always returns 0 (RMySQL) - separate connection issue

Original example as found in some post According to this post the following SQL statements should give me a vector 1, 2, 2, 2, 2 in the end: require("RMySQL") con <- dbConnect( dbDriver("MySQL"), db="your_db", user="your_user", …
Rappster
  • 12,762
  • 7
  • 71
  • 120
1
2
3
27 28