rmysql

How to make Shiny reactivity work with SQL database?

﹥>﹥吖頭↗ 提交于 2021-02-04 08:26:53
问题 Alright, I modified the script following @Pork Chop advice: server.R library(shiny) library(DT) library(RMySQL) con <- dbConnect(MySQL(), user="myuser", host="myhost", dbname="mydb") shinyServer(function(input, output) { sqlOutput <- reactive({ sqlInput <- paste0("select * from mydb.mytable", " where value < ", input$value, ";") dbGetQuery(con, sqlInput) }) output$table <- DT::renderDataTable(sqlOutput(), server=TRUE, rownames=FALSE, filter="top", options=list(pageLength=10)) output$download

R RMySQL query deforms japanese characters

一个人想着一个人 提交于 2020-01-13 19:13:36
问题 I am using RMySQL to connect to an aws MySQL server. It works, except character values are deformed. This question has been asked before but the fixes don't seem to work for me. Here's what I'm doing: Make sure no connections are open: dbListConnections(MySQL()) list() Make sure my connection is set to use UTF-8: dbGetQuery(credentials, "show variables like 'character_set%'") Variable_name Value 1 character_set_client utf8 2 character_set_connection utf8 3 character_set_database utf8 4

R -RMySQL- how to save more sql queries to file?

蹲街弑〆低调 提交于 2020-01-06 07:22:53
问题 I do some data analysis in R. On end of script I want save my results to file. I know there is more options how to do it, but they don't work properly. When I try sink() it works but it give me : <MySQLResult:1,5,1> host logname user time request_fline status 1 142.4.5.115 - - 2018-01-03 12:08:58 GET /phpmyadmin?</script><script>alert('<!--VAIBS-->');</script><script> HTTP/1.1 400 size_varchar referer agent ip_adress size_int cookie time_microsec filename 1 Mozilla/5.0 (Windows NT 10.0; WOW64

importing date correctly from MySQL into R

本秂侑毒 提交于 2020-01-03 18:50:49
问题 My question is pretty much the same as this one. In short, I'm using dplyr (along with RMySQL) to import a MySQL table with a datetime column, and I want to convert it to date in R. In the question linked above, no answer was posted, only a comment by Hadley. The OP apparently found a solution based on the comment made. I understood from Hadley's comment that I could solve the issue by properly importing the column as date into R. Then there would be no need to use as.Date. However, I couldn

Missing mysql.h and trying to find mysql-devel

梦想的初衷 提交于 2019-12-31 01:48:30
问题 (I've been through four or five questions that are related to mine, but this sticking point I run into doesn't seem to be addressed in them.) In trying to run RMySQL on RStudio on a windows machine, I've been trying to follow the help given here: How to Connect R with MySQL or how to install RMySQL package? and here: Using MySQL in R for Windows I was able to complete steps 1,3,4,5 but not #2. I've tried searching for the missing header mysql.h itself, but everything I find is for a different

RMySQL installing error on Fedora 28, Rstudio version 1.1.4,

隐身守侯 提交于 2019-12-25 02:44:40
问题 Whenever I try to install RmySQL on Rstudio it gives me this "compiler" error tho I've installed all the requires dependencies. > install.packages("RMySQL", dependencies=TRUE) Installing package into ‘/home/nizar/R/x86_64-redhat-linux-gnu-library/3.4’ (as ‘lib’ is unspecified) also installing the dependency ‘curl’ trying URL 'https://cran.rstudio.com/src/contrib/curl_3.2.tar.gz' Content type 'application/x-gzip' length 367047 bytes (358 KB) ==================================================

Using RMySQL interferes with RPostgreSQL

吃可爱长大的小学妹 提交于 2019-12-24 02:39:15
问题 I have an R script where I want to pull some data from a MySQL database, then from a PostgreSQL database. However, loading the MySQL driver from RMySQL prevents me from loading the PostgreSQL driver from PostgreSQL . I can load the Postgres driver fine on its own: > RPostgreSQL::PostgreSQL() <PostgreSQLDriver:(58810)> Then I can load the RMySQL driver: > RMySQL::MySQL() <MySQLDriver> However, if I load the MySQL driver first, the PostgreSQL driver fails to load: > RMySQL::MySQL() <MySQLDriver

UTF8 encoding using RMySQL

ぐ巨炮叔叔 提交于 2019-12-23 02:24:13
问题 I am trying to query data from a mysql database, which contains some strings, of course. For the connection and data retrieval I am using RMySQL in R, which works fine. Apart from one thing: the strings I am retrieving seem not to be in utf8. But I need this, because I have some german "Umlaute" in these strings. When I ask teh databse, which are its encoding by dbGetQuery(db, "SHOW VARIABLES LIKE 'character_set_%';") I get the desired answer: Variable_name Value 1 character_set_client utf8 2

RMySQL, fetch errors - RS-DBI driver warning: (error while fetching rows)

妖精的绣舞 提交于 2019-12-22 08:35:11
问题 I am using RMySQL to fetch some rows from a data table (the table is large so I cannot post it here but basically contains a bunch of numbers.. a total of 10 columns and about 12,000 rows). I get the following error when I run fetch(con, n=-1) : RS-DBI driver warning: (error while fetching rows) and the server returns only 1713 rows. If I get rid of some of the columns being fetched then this seems to work fine. Does anyone know what this can be related to? I don't even know where to start

Error installing RMySQL

拥有回忆 提交于 2019-12-22 08:08:50
问题 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 there's no progress yet for two days. It broke down after "running command sh ./configure.win had status 127 error, and I cannot find what this means. Can anyone shed some lights on this? install.packages('RMySQL',type='source') Installing package