1 How to setup the MySQL database for GNUnet.
3 NOTE: This db module does NOT work with mysql before 4.1 since we need
4 prepared statements. We are generally testing the code against MySQL
10 + On up-to-date hardware where mysql can be used comfortably, this
11 module will have better performance than the other db choices
12 (according to our tests).
13 + Its often possible to recover the mysql database from internal
14 inconsistencies. The other db choices do not support repair
15 (gnunet-check cannot fix problems internal to the dbmgr!).
16 For example, we have seen several cases where power failure
17 has ruined a gdbm database beyond repair.
18 + much faster (for one of the key benchmarks -- content migration
19 -- we have measure mysql taking 2s for an operation where
22 - Memory usage (Comment: "I have 1G and it never caused me trouble")
25 MANUAL SETUP INSTRUCTIONS
27 1) in /etc/gnunet.conf, set
30 2) Then access mysql as root,
32 and do the following. [You should replace $USER with the username
33 that will be running the gnunetd process].
35 CREATE DATABASE gnunet;
36 GRANT select,insert,update,delete,create,alter,drop,create temporary tables
37 ON gnunet.* TO $USER@localhost;
38 SET PASSWORD FOR $USER@localhost=PASSWORD('$the_password_you_like');
41 3) In the $HOME directory of $USER, create a ".my.cnf" file
42 with the following lines
46 password=$the_password_you_like
48 Thats it. Note that .my.cnf file is a security risk unless its on
49 a safe partition etc. The $HOME/.my.cnf can of course be a symbolic
50 link. Even greater security risk can be achieved by setting no
51 password for $USER. Luckily $USER has only priviledges to mess
52 up GNUnet's tables, nothing else (unless you give him more,
55 4) Still, perhaps you should briefly try if the DB connection
56 works. First, login as $USER. Then use,
61 If you get the message "Database changed" it probably works.
63 [If you get "ERROR 2002: Can't connect to local MySQL server
64 through socket '/tmp/mysql.sock' (2)" it may be resolvable by
65 "ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock"
66 so there may be some additional trouble depending on your mysql setup.]
68 5) If you want to run the testcases, you must create a second
69 database "gnunetcheck" with the same username and password.
70 This database will then be used for testing ("make check").
75 - Its probably healthy to check your tables for inconsistencies
76 every now and then, especially after system crashes.
77 - If you get odd SEGVs on gnunetd startup, it might be that the mysql
78 databases have been corrupted.
79 - The tables can be verified/fixed in two ways;
80 1) by shutting down mysqld (mandatory!) and running
82 in /var/lib/mysql/gnunet/ (or wherever the tables are stored).
83 Another repair command is "mysqlcheck". The usable command
84 may depend on your mysql build/version. Or,
86 mysql> REPAIR TABLE gn090;
91 If you have problems related to the mysql module, your best friend is
92 probably the mysql manual. The first thing to check is that mysql is
93 basically operational, that you can connect to it, create tables,