mysql -u root -p   //로그인

create database rprogramming;

use rprogramming;


create table rtest(name varchar (20),

    -> score integer);



insert into rtest2 values("a",50);

insert into rtest2 values("b",90);


dbConnect(MySQL(), user = "root" , password = "1234", host = "127.0.0.1", dbname="rprogramming")


install.packages("RMySQL")
library(RMySQL)

con = dbConnect(MySQL(), user = "root" , password = "1234",
                host = "127.0.0.1", dbname="rprogramming")

dbListTables(con)
df = dbGetQuery(  con, "select * from rtest2"  )
str(df)
class(df)




+ Recent posts