Can't use a MySQL remote db using a ssh tunnel

105 Views Asked by At

I work with a remote db using a ssh tunnel:

ssh -f myuser@ssh_server -N -L 7777:dbi_server:3306

I put my password, and then I can do this:

mysql -u myuser -h localhost --port=7777

I can access my db and do queries

But from R or Rstudio, I can't:

DBI::dbConnect(
    RMySQL::MySQL(),
    user = 'myuser',
    host = '127.0.0.1',
    port = 3306,
    dbname = 'dbi_name'
    )

Failed to connect to database: Error: Access denied for user 'myuser'@'localhost' (using password: NO)

This is after I connect the ssh tunnel Any help will be much appreciated

0

There are 0 best solutions below