RSQLite
からに移動していますが、 フィールドとフィールドRMySQL
に混乱しています。FWIW、私は Windows 7、R 2.12.2、MySQL 5.5 (すべて 64 ビット)、および RMySQL 0.7-5 を実行しています。user
password
この以前の SO の質問RMySQL
で規定されているようにインストールしましたが、動作することがわかっている限り (つまり、.xml でパッケージをロードできます)。しかし、R データ インポート ガイドからチュートリアルを実行しようとすると、「データベースへの接続に失敗しました...」というエラーが表示されます。これは、ガイドのチュートリアルのコードです。library(RMySQL)
library(RMySQL) # will load DBI as well
## open a connection to a MySQL database
con <- dbConnect(dbDriver("MySQL"), user = "root", password = "root", dbname = "pookas")
## list the tables in the database
dbListTables(con)
## load a data frame into the database, deleting any existing copy
data(USArrests)
dbWriteTable(con, "arrests", USArrests, overwrite = TRUE)
dbListTables(con)
## get the whole table
dbReadTable(con, "arrests")
## Select from the loaded table
dbGetQuery(con, paste("select row_names, Murder from arrests",
"where Rape > 30 order by Murder"))
dbRemoveTable(con, "arrests")
dbDisconnect(con)
2 行目に次のエラーが表示されます。
> con <- dbConnect(dbDriver("MySQL"), user = "richard", password = "root", dbname = "pookas")
Error in mysqlNewConnection(drv, ...) :
RS-DBI driver: (Failed to connect to database: Error: Access denied for user 'richard'@'localhost' (using password: NO)
)
admin as の有無user
にかかわらず試してみました。また、以前に作成したコマンドラインと存在しないものを使用してみました。password
user
dbname
任意のヒント?ここに良いリファレンスはありますか?ありがとう!