1

I have downloaded the MYSQL docker image locally. Now trying to run Rscript in docker to connect to MYSQL using host given in the IPaddress section of Docker inspect (say “172.17.0.2” ), port 3306, username: root, and database: MySQL.

RScript Database connection ::

con <- dbConnect(RMySQL::MySQL(), dbname = “mysql”, host=“172.17.0.2”, port=3306,
username = “root”, password = )

But getting error , stating the host does not exist.

I even tried using various options of the host like “localhost”. But still failing to connect stating, Error in .local(drv, ...) :

Failed to connect to database: Error: Can't connect to MySQL server on 'localhost' (0)

Calls: dbConnect -> dbConnect -> .local -> .Call Execution halted

Pacifist
  • 3,025
  • 2
  • 12
  • 20

0 Answers0