[GRASSLIST:723] Grass 6.1.cvs/MySQL - how?

David Adam david at quercus.org
Sun Apr 16 20:26:14 EDT 2006


I'm confused as to how to use MySQL 4.0.16 with Grass 6.1.cvs on a
Fedora Core 4 system.  I'll start with what seems pretty basic: the 
"test database" choice
in the GUI interface.  The results I get are shown here:

db.test test=test1
create table grass_test1 (i1 integer, d1 double precision, c1 varchar(20))
EXECUTE: OK
insert into grass_test1 values ( 1, 123.456, 'abcd' )
EXECUTE: OK
insert into grass_test1 values ( 2, null, 'xxx' )
EXECUTE: OK
select * from grass_test1
dbmi: Protocol error
EXECUTE: ******** ERROR ********
0a1,2
 > 1|123.456000|abcd
 > 2||xxx
RESULT: ******** ERROR ********
select c1 from grass_test1 where d1 < 500 / 2 and i1 <> 2  and c1 ~ 'bc'
dbmi: Protocol error
EXECUTE: ******** ERROR ********
0a1
 > abcd
RESULT: ******** ERROR ********
insert into grass_test1 values ( 3, 0.0, '_''_' )
EXECUTE: OK
alter table grass_test1 add column i2 integer
EXECUTE: OK
update grass_test1 set d1 = 18.6, i2 = 987  where i1 = 2
EXECUTE: OK
select * from grass_test1
dbmi: Protocol error
EXECUTE: ******** ERROR ********
0a1,3
 > 1|123.456000|abcd|
 > 2|18.600000|xxx|987
 > 3|0.000000|_'_|
RESULT: ******** ERROR ********
drop table grass_test1
EXECUTE: OK

It looks like the driver and mysql are doing something, but returning 
errors.
This is undoubtedly a sign that I have missed something, but what?

I'm also confused about where the mysql data are stored.  The 
documentation for
grass suggests that all data are stored in a primary directory 
(/gis/data in my case),
and I am able to work with both raster and vector layers stored there.  
But mysql
has its own special data area (/var/lib/mysql in my case). 

In order to use db.connect to hook up to mysql, the database must first 
exist (with proper
access permissions), so I have created a mysql database using mysql and 
then tried to
connect to it using db.connect, without apparent success. 

I am assuming that if I import a vector file that includes both vectors 
and attributes, grass
should automatically create an attribute table to match the vectors, 
populating it with data
and linking it to the vector file as part of the importing process.  Is 
this correct, or is there
something else I need to do?

I have read through all of the documentation I could get ahold of, but 
have not been able
to get the system to work.  Any help would be most appreciated...

david adam




More information about the grass-user mailing list