[GRASSLIST:9614] Re: Using unixODBC to connect GRASS to MySQL [Mac] - please test iODBC anyone

Nick Cahill ndcahill at facstaff.wisc.edu
Thu Dec 22 16:14:16 EST 2005


OK, I just tried it again, this time running grass61 -gui and so  
avoiding the WISH and gui problems.

I tried a bit more fussing with the setup. ODBC is a mystery to me,  
and I'm probably messing it up. I tried installing the driver first  
in my own Library/ODBC directory, then in the system wide /Library/ 
ODBC, and experimented with both system DSN and user DSN's. The user  
DSN didn't work:

db.test test=test1
create table grass_test1 (i1 integer, d1 double precision, c1 varchar 
(20))
DBMI-ODBC driver error: SQLConnect():
[iODBC][Driver Manager]Data source name not found and no default  
driver specified. Driver could not be loaded (0)

... etc. etc....

Setting up ODBC as a system DSN gave different errors:
db.test test=test1
create table grass_test1 (i1 integer, d1 double precision, c1 varchar 
(20))
DBMI-ODBC driver error: SQLConnect():
[DataDirect][ODBC SequeLink driver][SequeLink Client]TCP/IP error,  
connection refused (2306)

EXECUTE: ******** ERROR ********
insert into grass_test1 values ( 1, 123.456, 'abcd' )
DBMI-ODBC driver error: SQLConnect():
[DataDirect][ODBC SequeLink driver][SequeLink Client]TCP/IP error,  
connection refused (2306)

So at least it seems to be locating the driver, but the driver isn't  
connecting to the database?  Here the instructions that come with  
FMP7 aren't that helpful to me; I'm sure they'd be enough for someone  
who knows ODBC. I used the ODBC Administrator that comes with Mac OSX  
10.4.3, set up a System DSN with values Host=localhost, Port=2399,  
ServerDataSource = database name, in this case just ODBCTest.  
Filemaker is set up to share the database via ODBC, and is running.

Ideas?

Nick Cahill






On Dec 22, 2005, at 5:34 PM, William Kyngesburye wrote:

> (I bumping this back to the list, Nick)
>
> On Dec 22, 2005, at 1:28 AM, Nick Cahill wrote:
>
>> Dear William,
>>
>> Sorry, it's been a very hectic couple weeks and I had to put off  
>> testing GRASS and Filemaker.
>
> I hear you.
>
>> I just made a stab at it - installing the ODBC driver and such. I  
>> have FMP 7 and the driver, and hope they're configured correctly.  
>> However, when I run your GRASS, I get an error:
>>
>>
>> channel "console1" wasn't opened for writing
>> channel "console1" wasn't opened for writing
>>     while executing
>> "error $fh"
>>     (procedure "run_cmd" line 24)
>>     invoked from within
>> "run_cmd 2"
>>     invoked from within
>> ".dialog1.run invoke"
>>     ("uplevel" body line 1)
>>     invoked from within
>> "uplevel #0 [list $w invoke]"
>>     (procedure "tk::ButtonUp" line 23)
>>     invoked from within
>> "tk::ButtonUp .dialog1.run"
>>     (command bound to event)
>>
>>
>> so I can't run any GUI commands.
>>
> Is that right when you run grass in GUI mode?  ie grass61 -gui.   
> Oh, your tcl/wish settings might be looking at a different Tcl/Tk.   
> Try setting this in your .bash_profile:
>
> export GRASS_TCLSH=/usr/local/grasslibsx/bin/tclsh8.4
> export GRASS_WISH=/usr/local/grasslibsx/bin/wish8.4
>
> (or use setenv in .cshrc for the tcsh)
>
>>
>> So I tried it from the command line. I had set up a FMPro database  
>> called ODBCTest, shared it from within FM, but I don't have the  
>> ODBC Admin program that lets me test whether the connection is  
>> actually set up - so there may be a problem there. .In any case I  
>> got:
>>
>>
>> GRASS 6.1.cvs (sardis):/usr/local/bin > db.connect driver=odbc  
>> database=ODBCTest
>> GRASS 6.1.cvs (sardis):/usr/local/bin > db.test test=test1
>> create table grass_test1 (i1 integer, d1 double precision, c1  
>> varchar(20))
>> DBMI-ODBC driver error: SQLConnect():
>> [iODBC][Driver Manager]Data source name not found and no default  
>> driver specified. Driver could not be loaded (0)
>>
>> ...
>>
> I think this is where the DSN comes in.  As it says, iODBC doesn't  
> have a DSN defined for the database you specified.  The DSN ties a  
> specific database name (what you use in db.connect) to an ODBC  
> driver and source database.  The GRASS docs for the db commands  
> don't say much on this (maybe somewhere there is more info), but  
> the GDAL docs on ODBC connections helped me to understand this.   
> How you setup the DSN (parameters and such) is still hazy, all I  
> know is you use ODBC Administrator.
>
> Someone on the list might know more about ODBC.  I hope we can get  
> this working ^_^
>
>
> -----
> William Kyngesburye <kyngchaos at kyngchaos.com>
> http://www.kyngchaos.com/
>
> Earth: "Mostly harmless"
>
> - revised entry in the HitchHiker's Guide to the Galaxy
>




More information about the grass-user mailing list