]> git.openstreetmap.org Git - rails.git/blob - db/README
Force C99 mode.
[rails.git] / db / README
1 Creating database
2 ===================
3
4 OSM server uses a database with the following name:
5
6 openstreetmap
7
8 You may create it with your preferable client or run next (linux) command:
9
10 $ mysql -u <uid> -p
11
12 (change <uid> with appropriate username of administrative user eg. root )
13
14 > create database openstreetmap default character set utf8;
15 > exit
16
17 Creating user, password, and access rights
18 ============================================
19
20 $ mysql -u <uid> -p
21
22 (change <uid> with appropriate username of administrative user eg. root )
23
24 > grant all privileges on openstreetmap.* to 'openstreetmap'@'localhost' identified by 'openstreetmap';
25 > flush privileges;
26 > exit
27
28 Creating functions
29 ====================
30
31 Run this command in the db/functions directory:
32
33 $ make
34
35 The above command should work for linux and most other Unix systems
36 that use ELF shared objects. For MacOS X you will need to do:
37
38 $ make libquadtile.dylib
39
40 Make sure the db/functions directory is on the MySQL server's library
41 path and restart the MySQL server. On linux the easiest way to do this
42 is to create /etc/ld.so.conf.d/osm.conf and place the path to the
43 db/functions directory in it and then run the following command as root:
44
45 $ ldconfig
46
47 Now create the functions as follows:
48
49 $ mysql -u <uid> -p openstreetmap
50
51 (change <uid> with appropriate username of administrative user eg. root )
52
53 > create function tile_for_point returns integer soname 'libquadtile.so';
54 > exit
55
56 or, for MacOS X:
57
58 > create function tile_for_point returns integer soname 'libquadtile.dylib';
59 > exit
60
61 Creating database skeleton tables
62 ===================================
63
64 Run this command from the root of your rails directory:
65
66 $ rake db:migrate
67
68 This will create the db for you