1grass-mysql(1)                Grass User's Manual               grass-mysql(1)
2
3
4
5MySQL  driver  in  GRASS MySQL database driver in GRASS enables GRASS to store
6vector attributes in MySQL server.
7
8       Because vector attribute tables are created  automaticaly  when  a  new
9       vector  is written and the name of the table is the same as the name of
10       the vector it is good practice to create a new database for each  GRASS
11       mapset.
12

Creating a MySQL database

14       A new database is created within MySQL:
15       mysql> CREATE DATABASE mydb;
16        See the MySQL manual for details.
17

Driver and database name

19       GRASS  modules  require  2  parameters to connect to a database.  Those
20       parameters are 'driver' and 'database'. For MySQL driver the  parameter
21       'driver'  should be set to value 'mysql'.  The parameter 'database' can
22       be given in two formats:
23
24                      Database name - in case of connection from localhost
25
26                      String of comma separated  list  of  kye=value  options.
27                     Supported options are:
28
29                             dbname - database name
30
31                             host - host name or IP address
32
33                             port - server port number
34       Examples of connection parameters:
35         db.connect driver=mysql database=mytest
36         db.connect driver=mysql database='dbname=mytest,host=test.grass.org'
37
38

Data types

40       GRASS supports almost all MySQL data types with following limitations:
41
42                      Binary columns (BINARY, VARBINARY, TINYBLOB, MEDIUMBLOB,
43                     BLOB, LONGBLOB) are not not supported.  If a  table  with
44                     binary  column(s)  is  used in GRASS a warning is printed
45                     and only the supported  columns  are  returned  in  query
46                     results.
47
48                      Columns  of  type SET and ENUM are represented as string
49                     (VARCHAR).
50
51                      Very large integers in columns of  type  BIGINT  can  be
52                     lost  or  corrupted because GRASS does not support 64 bin
53                     integeres on most platforms.
54
55                      GRASS does not currently distinguish types TIMESTAMP and
56                     DATETIME.  Both  types  are in GRASS interpreted as TIME‐
57                     STAMP.
58

Indexes

60       GRASS modules  automaticaly  create  index  on  key  column  of  vector
61       attributes  table. The index on key column is important for performance
62       of modules which update  the  attribute  table,  for  example  v.to.db,
63       v.distance and v.what.rast.
64

Privileges

66       Because  MySQL  does not support groups of users and because only MySQL
67       'root' can grant privileges to other users  GRASS  cannot  automaticaly
68       grant select privileges on created tables to group of users.
69
70       If  you  want  to give privilege to read data from your mapset to other
71       users you have to ask your MySQL server administrator to  grant  select
72       privilege to them on the MySQL database used for that mapset. For exam‐
73       ple, to allow  everybody to read data in from your database 'mydb':
74
75       shell> mysql --user=root mysql
76       mysql> GRANT SELECT ON mydb.* TO ''@'%';
77
78

Schemas

80       Because MySQL does not support database schemas the parameter  ’schema'
81       of  module db.connect should never be set to any value. If you set that
82       parameter for MySQL driver GRASS will try to write tables to the speci‐
83       fied schema which will result in errors.
84

Groups

86       MySQL  does  not support user groups. Any settings specified by 'group'
87       parameter of module db.connect are ignored by GRASS for MySQL driver.
88

SEE ALSO

90       SQL support in GRASS GIS
91

Credits

93       Development of the driver was sponsored by Faunalia (htttp://www.fauna‐
94       lia.it) as part of a project for ATAC (http://www.atac.roma.it/).
95

AUTHOR

97       Radim Blazek
98
99       Last changed: $Date: 2006/08/24 19:11:36 $
100       Help Index
101
102
103
104GRASS 6.2.2                                                     grass-mysql(1)
Impressum