1

次のコードを使用して、R を自分の MySQL サーバー (つまり、localhost サーバー) に接続しました。

con <- dbConnect(MySQL(),user="root",password="********",dbname="try",host="localhost")

dbListTables(con) # to see what all tables the database has

#data(test) (shows error becuase its not yet in R, its still on server)

dbListFields(con, 'test')  #to see what all fields the table has

rs <- dbSendQuery(con, "SELECT * FROM test") #data is still on the server

data <- fetch(rs, n = -1) #using fetch to bring data into R

ここで、他の誰かの MySQL サーバーに接続して (つまり、IP が異なり、サーバーがシステム/マシン上にある)、そこからデータを取得する必要があります。

では、どのような詳細が必要で、コードでどのような変更を行う必要があるのでしょうか?

ありがとうございました。

4

1 に答える 1