source: subversion/sites/rails_port/db/README @ 7415

Last change on this file since 7415 was 6525, checked in by xin, 12 years ago

added mac os x instructions for db function creation

File size: 1.6 KB
Line 
1Creating database
2===================
3
4OSM server uses a database with the following name:
5
6openstreetmap
7
8You 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
17Creating 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
28Creating functions
29====================
30
31Run this command in the db/functions directory:
32
33$ make
34
35Make sure the db/functions directory is on the MySQL server's library
36path and restart the MySQL server.
37
38On Linux the easiest way to do this is to create /etc/ld.so.conf.d/osm.conf, and place the path to the db/functions directory in it and then run the ldconfig command as root.
39
40On OS X: sudo ln -s /path_to_your_osm_install/sites/rails_port/db/functions/libmyosm.so /usr/local/lib/libmyosm.so
41
42Now create the functions as follows:
43
44$ mysql -u <uid> -p openstreetmap
45
46(change <uid> with appropriate username of administrative user eg. root )
47
48> create function tile_for_point returns integer soname 'libmyosm.so';
49> create function maptile_for_point returns integer soname 'libmyosm.so';
50> exit
51
52Creating database skeleton tables
53===================================
54
55Run this command from the root of your rails directory:
56
57$ rake db:migrate
58
59This will create the db for you
Note: See TracBrowser for help on using the repository browser.