I'm trying to connect to a MySQL database using this code:
con <- dbConnect(RMySQL::MySQL(),
dbname = "XX",
host = "YY",
port = ZZ,
user = "AA",
password = "BB"
)
And I'm getting this error:
Error in .local(drv, ...) :
Failed to connect to database: Error: Can't connect to MySQL server on 'YY' (0)
I've tried with this other code:
pool <- dbPool(drv = RMySQL::MySQL(),
dbname = "XX",
host = "YY",
username = "AA",
password = "BB",
port = ZZ
)
And get the same error:
Error in .local(drv, ...) :
Failed to connect to database: Error: Can't connect to MySQL server on 'YY' (0)
I can connect to this database using Workbench, so I guess it's a problem with R.
Any solution to this problem?