Reputation: 640
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
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