R语言连接MySQL报错:could not run statement: The used command is not allowed with this MySQL version

版本说明

R版本:3.5

MySQL版本:8.0

RMySQL版本:0.10.19

情景说明:

使用RMySQL成功连接到MySQL数据库,可以进行查询操作,但在插入时报错,提示信息如下:

con <- dbConnect(MySQL(), host="127.0.0.1", dbname="epid", user="root", password="1234")
dbWriteTable(con,"city_dt",city,overwrite =FALSE,append=TRUE,row.names=FALSE) 

报错信息具体如下:

Error in .local(conn, statement, ...) : 
  could not run statement: The used command is not allowed with this MySQL version

解决方法:

 

install.packages("RMariaDB")
install.packages("zeallot")
library(RMariaDB)
library(zeallot)
con <- dbConnect(MariaDB(), host="127.0.0.1", dbname="epid", user="root", password="1234")
dbWriteTable(con,"city_dt",city,overwrite =FALSE,append=TRUE,row.names=FALSE) 

数据成功插入数据库;

 

转载请注明:

博客会同步发布在我的微信公众号以及简书上,搜索“数据志”(原跟着菜鸟一起学R语言)关注我。

原文链接:https://www.cnblogs.com/wheng/p/12316307.html

你可能感兴趣的:(R语言,mysql)