Questions tagged [rmariadb]
17 questions
2
votes
0 answers
How to connect to MariaDB on NAS and read the data?
From R running on a Ubuntu machine, I want to connect to a MariaDB living on a Synology NAS and read the table. As the documentation suggests, I do
library(RMariaDB)
con <- dbConnect(
drv=RMariaDB::MariaDB(),
username='',
…

jay.sf
- 60,139
- 8
- 53
- 110
2
votes
1 answer
dbWriteTable with geometry (point) type to MariaDB
Working with sf objects in R, as well as tables in MariaDB with geometry (in this case point) columns, I'm struggling to efficiently move data between the two (sf object to MariaDB table and vice-versa).
Note I'm using the RMariaDB package to…

rosscova
- 5,430
- 1
- 22
- 35
1
vote
2 answers
Save a tbl_sql in R to MySQL?
I'm just learning MySQL with R and am wondering if this is possible.
I performed a query on a database that exists on MySQL with the RMariaDB package, as follows:
library(RMariaDB)
con <- DBI::dbConnect(RMariaDB::MariaDB(),
…

dd_data
- 93
- 5
1
vote
1 answer
Failed to connect: access denied for user - MySQL DB hosted in AWS RDS
I´m trying to connect to a MySQL database hosted in AWS for a shiny dashboard with no success. It throws the error Access denied for user:
I'm sorry I can´t produce a reprex because I don´t have control over the aws infrastructure. Any advice on…

AleG
- 153
- 8
1
vote
2 answers
RMySQL dbDisconnect is not closing the DB connection
dbDisconnect function of RMySQL library is not closing the DB connection properly. Here is the code I have tried out in my local to test it
library(RMySQL)
execute.query <- function(query){
mydb_con <- dbConnect(MySQL(), user='username',…

Ajithkumar_sekar
- 631
- 9
- 23
1
vote
1 answer
Error while using dbWriteTable to write a table with existing key
I am running the code below
dbWriteTable(conn = mydb, "countries", cntr, overwrite = TRUE, row.names = FALSE)
and getting the error
Error: Cannot drop table 'countries' referenced by a foreign key constraint 'general_pop_estimates_ibfk_1' on table…

Stephen Okiya
- 315
- 1
- 8
1
vote
1 answer
R using RMariaDB unable to connect with .mylogin.cnf
I'm developing a script in RStudio which connects to local MySQL Server using the R package RMariaDB (not RMySQL - for other reasons though the outcome is the same).
I can both connect via storing the password in the script like:
localuserpassword…

Oscar_W
- 11
- 2
0
votes
0 answers
cannot upload tweets with emojis to mysql database using RMariaDB
Original Post
I am trying to gather some tweets using the {rtweet} package and store them in a MySQL database. But I am getting errors whenever I try to upload a tweet that contains emojis.
Here is my code:
# loading…

Wahiduzzaman Khan
- 155
- 8
0
votes
1 answer
Loading ~10k records into MariaDB from R with good performance
I'm seeing a 300-fold performance penalty, depending on which drivers I use, and the fast one is unavailable on shinyapps.io.
I'm reading a CSV into a tibble using readr::read_csv, then using dbWriteTable() to upload it to my MariaDB database. If I…

MattB
- 15
- 5
0
votes
1 answer
R / RMariaDB: How to avoid "Lost connection to server during query" in a loop
I use RMariaDB::dbConnect() to establish a connection to my MySQL database in R.
It works well, but during a long for-loop where I insert values into the database with each iteration (using dbSendStatement()), it happens every so often that I get…

anpami
- 760
- 5
- 17
0
votes
1 answer
Saving dbplyr query (tbl_sql object) to MySQL without saving data locally
This question expands on this question
Here, I'm using the custom function created by @Simon.S.A. shown in the answer to this question. I'm attempting to save a tbl_sql object in R to MySQL as a new table without first saving it locally. Here, the…

dd_data
- 93
- 5
0
votes
1 answer
perform unite function using only dplyr commands?
Is there any way to concatenate two variables together using only dplyr commands?
For example:
df <- mtcars
df <- select(df, mpg, cyl)
df$mpg <- as.character(df$mpg)
df$cyl <- as.character(df$cyl)
df <- unite(df, "new_var", c(mpg, cyl), sep="",…

dd_data
- 93
- 5
0
votes
0 answers
Can't use a MySQL remote db using a ssh tunnel
I work with a remote db using a ssh tunnel:
ssh -f myuser@ssh_server -N -L 7777:dbi_server:3306
I put my password, and then I can do this:
mysql -u myuser -h localhost --port=7777
I can access my db and do queries
But from R or Rstudio, I…

Pabort
- 348
- 1
- 11
0
votes
1 answer
Is there an efficient way to update MariaDB rows from a data frame in R?
I am collecting live data from a website which populates a data frame in R.
The rows could have the same unique id's, or new rows could be introduced.
I want to send the dynamic data frame to a MariaDB database table, where the rows with existing…

Nowak
- 135
- 2
- 14
0
votes
0 answers
RMariaDB doesn't seem to allow me to connect to a MySQL server
I'm trying to connect to a MySQL server from R. I'm using the RMariaDB package and I keep getting the following error.
Error: Failed to connect: Plugin https could not be loaded: The specified module could not be found. Library path is…