Skip to content
Prev 132129 / 398506 Next

connecting RMySQL to and external server

It is trivial with RODBC (I know that is not what you asked, but it is the 
solution we found first).


For RMySQL, note first that the MySQL configuration file is consulted, so 
the default host is specified in the client section, which is like

[client]

port=3306

[mysql]

default-character-set=latin1

Add host=foo under [client] to change the default host.

And ?dbConnect mentions a 'host' argument under '...'.  That seems to work 
for me (provided of course the server allows connections from other 
machines): on my home network from Windows laptop to Linux server
Loading required package: DBI
This mixture of using the *local* configuration file overridden by 
arguments is a bit dangerous: RMySQL seems not really designed for 
client-server operation and there are some things that definitely do not 
work.  (As I recall, that included dbWrite as that imports a file which is 
on the local machine.)
On Fri, 14 Dec 2007, Adrian Dusa wrote: