Count Zero
Count Zero

Reputation: 640

Exploring a MySQL database with R and dplyr

I just received an export from a MySQL database as a file mydb.sql. I installed MySQL in my Mac OS 10.10 laptop, put the .sql file in "/usr/local/mysql/data/", started the MySQL server. In R I installed the packages dplyr, RMySQL and their dependencies. I tried the dpylr function:

src_mysql(dbname = "mydb.sql")

as well as a few variations on this, but I get the error

Failed to connect to database: Error: Unknown database 'mydb'

What am I missing?

Upvotes: 1

Views: 1075

Answers (1)

Count Zero
Count Zero

Reputation: 640

You have to create a database first, then import the data. Then the dplyr command works fine. This helped. If you are familiar with MySQL, this question probably annoyed you. R developers might find this more useful.

Upvotes: 3

Related Questions