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
3
votes
1 answer

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

I am trying to connect to MariaDB server running on Amazon RDS platform using the RMySQL package. Till few days back it was running fine, until I updated my packages to the latest version. Now trying to connect to the DB throws this error: Error:…
tushaR
  • 3,083
  • 1
  • 20
  • 33
3
votes
2 answers

Is there a faster way to upload data from R to MySql?

I am using the following code to upload a new table into a mysql database. library(RMySql) library(RODBC) con <- dbConnect(MySQL(), user = 'user', password = 'pw', host = 'amazonaws.com', dbname = 'db_name') dbSendQuery(con, "CREATE TABLE…
roarkz
  • 811
  • 10
  • 22
3
votes
0 answers

Connecting MySQL with Shiny

I would like to connect MySQL with the Shiny (R). I have been trying to run the code since last couple of days but it is not working. Following is my code: library(shiny) library(leaflet) library(DBI) library(RMySQL) saveData <-…
Cricketer
  • 399
  • 1
  • 3
  • 20
3
votes
0 answers

Error: ReadItem: unknown type 32, perhaps written by later version of R

am running a R script through cron for example R CMD BATCH myRFILE.R myOutFILE.Rout . When i run this from bash it runs successfully , however when i do this through cron for multiple R files i get the following error : Error: ReadItem: unknown…
Sushil Ks
  • 403
  • 2
  • 10
  • 18
3
votes
0 answers

RMysql dbWriteTable Error infinite recursion

I am trying to use dbWriteTable to store a data frame into MySQL database. Here is the code: mydb = getDbConnect(courseSlug) dbWriteTable(mydb, name = table_name, value = dataframe, overwrite = TRUE, row.names = FALSE , field.types =…
Mahsa Chitsaz
  • 111
  • 1
  • 5
3
votes
1 answer

Create a stored procedure using RMySQL

Background: I am developing a rscript that pulls data from a mysql database, performs a logistic regression and then inserts the predictions back into the database. I want the entire system to be self contained in the script in case of database…
3
votes
2 answers

Pass Parameter into RMySQL dbSendQuery

I'm having difficulties passing a value into dbSendQuery. Below is my code: Parameter: date_param <- '2014_02_02' Query: pull <- dbSendQuery(test_db, "select distinct product_id, group from test_table …
BlackHat
  • 736
  • 1
  • 10
  • 24
3
votes
1 answer

Storing reactive data in shiny from SQL

This is a follow up from this question: Acessing SQL database using shiny with reactive query I am trying to build a data frame from data fetched from an SQL database using a shiny app. Currently i am able to query the database and return one set of…
Pete900
  • 2,016
  • 1
  • 21
  • 44
3
votes
1 answer

Acessing SQL database using shiny with reactive query

I want to use Shiny to let a user build a data frame by accessing an SQL data base. I want it to work in the following way (but open to suggestions): User types in ID (its a number) User presses action button Reactive query is generated Query is…
Pete900
  • 2,016
  • 1
  • 21
  • 44
3
votes
1 answer

Leave connection to database open for the session or connect to it when it's useful

I'm working in R with a MySQL database to which I connect with RMySQL (and DBI). I have a function which read SQL table (and import them as R objects) on the fly, when the user need them. He can read table often or don't send a query to the database…
Julien Navarre
  • 7,653
  • 3
  • 42
  • 69
3
votes
1 answer

In is(object, Cl) : error while fetching rows R

I have a MySQL table I am attempting to access with R using RMySQL. There are 1690004 rows that should be returned from dbGetQuery(con, "SELECT * FROM tablename WHERE export_date ='2015-01-29'") Unfortunately, I receive the following warning…
Optimus
  • 1,354
  • 1
  • 21
  • 40
3
votes
1 answer

RMySQL incorrectly querying column with type bit

We have a database and several columns are of type bit. When querying them using the RMySQL package, the incorrect results are returned. To reproduce, in a SQL prompt: CREATE TABLE suppliers ( aId varchar(10) not null, aBit bit not…
JHowIX
  • 1,683
  • 1
  • 20
  • 38
3
votes
1 answer

RMYSQL- Insert Ignore, Replace -R

I am exporting data to a MySQL database from R using the RMySQL package. A big problem I am facing is duplicates: I have too many entries with same values. The system automatically produces the results and inserts the dataframe into the…
3
votes
2 answers

How specify join variables with different names in different MySQL tables

I need to join two tables where the common column-id that I want to use has a different name in each table. The two tables have a "false" common column name that does not work when dplyr takes the default and joins on columns "id". Here's some of…
John David Smith
  • 573
  • 1
  • 6
  • 15
3
votes
1 answer

Query on multiple tables using dbGetQuery of RMySQL package

With the help of dbConnect, multiple connections were established with SQL DBs (say, DB1 and DB2). How can I write a query that involves tables from DB1 and DB2? Does dbGetQuery allow querying one only one DB? Can sqldf package be leveraged after…
Anindita
  • 31
  • 3