I am trying to connect to MySQL from R. I have installed "8.0.11 MySQL Community Server – GPL" on my machine. In R studio, I have installed RMySQL Library.
When I give the command:
con = dbConnect(RMySQL::MySQL(),user="root", password = "password", dbname="test")
I keep getting the error:
Error in .local(drv, …) : Failed to connect to database: Error:
Unknown database 'test'
I am not sure why it keep giving this error. Any suggestions?
Best Solution
Here is a code I use for access to MySQL from R
Please, check how it works on your side.
PS. Looks like you miss 'db_table' parameter.