简体   繁体   中英

R how to select the database I connect?

I have both MySQL and MariaDB on my computer, originally I only used MySQL, but recently I have a program using MariaDB. so I used the following script to extract the data

library(RMariaDB)

# export table from mySQL 
database <- "movesdb20201105"
mydb = DBI::dbConnect(RMariaDB::MariaDB(), user='moves', password='moves', #actually from RMySQL
                      dbname = database, host= "localhost")

rs_tmp = DBI::dbSendQuery(mydb, "SELECT * FROM emissionratebyage")

but I look into the connection, it connects to MySQL not MraiaDB, how can I fix this?

Thanks

MariaDB is the successor of MySQL. Maybe just a wrong label? Also try unloading the MySQL library.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM