[R] rodbc or unixodbc error

Sebastian Luque sluque at mun.ca
Tue Feb 22 02:18:24 CET 2005


Hi,

I'm trying to establish a connection to a MySQL database, and am using the
rodbc package for it. This is in a GNU/Debian Linux box, with the
corresponding Debian unstable packages. I can login to my MySQL databases
from any shell and directory, so the problem is probably not there. Here's
an example of what I'm doing:

R> odbcConnect("test", uid="myusername", pwd="mypassword")
[1] -1
Warning messages: 
1: [RODBC] ERROR: state IM002, code 0, message [unixODBC][Driver Manager]Data source name not found, and no default driver specified 
2: ODBC connection failed in: odbcDriverConnect(st, case = case, believeNRows = believeNRows)


The error is apparently from unixodbc, and googling for it I found that
somebody solved it by specifying a default driver in a odbc.ini file. Can
somebody please tell whether this is the right approach, and if so, how to
write that specification? I saw that one might do this in a ~/.odbc.ini
(i.e. the user's config file) file.

Best wishes,
-- 
Sebastian Luque




More information about the R-help mailing list