[R] connecting [logging] RMySQL to an external server - SOLVED

Adrian Dusa dusa.adrian at gmail.com
Wed Dec 19 18:30:57 CET 2007

On Wednesday 19 December 2007, Dirk Eddelbuettel wrote:
> [...]
> Err, I am late to this but
>  dbConnect(drv, user="mysqluser", password="mysqlpassword",
> dbname="anydatabase", host="xxx.xxx.xxx")
> works fine for me (eg on Ubuntu with a remote MySQL on some other
> box).  What's the problem you were seeing?

The remote host expects a login username and password (different from the 
MySQL username and password), which I cannot provide in the dbConnect 
The solution is to first login to the external machine (a secure login using 
ssh), forwarding the MySQL port 3306 to the local port 3307 (not to interfere 
with the local MySQL server), and connecting R to the remote MySQL server 
using the ssh tunneling binded to local port 3307.


Adrian Dusa
Romanian Social Data Archive
1, Schitu Magureanu Bd
050025 Bucharest sector 5
Tel./Fax: +40 21 3126618 \
          +40 21 3120210 / int.101

More information about the R-help mailing list