aboutsummaryrefslogtreecommitdiff
path: root/doc/README.mysql
diff options
context:
space:
mode:
Diffstat (limited to 'doc/README.mysql')
-rw-r--r--doc/README.mysql95
1 files changed, 95 insertions, 0 deletions
diff --git a/doc/README.mysql b/doc/README.mysql
new file mode 100644
index 0000000..84aeb24
--- /dev/null
+++ b/doc/README.mysql
@@ -0,0 +1,95 @@
+How to setup the MySQL database for GNUnet.
+
+NOTE: This db module does NOT work with mysql before 4.1 since we need
+prepared statements. We are generally testing the code against MySQL
+5.0 at this point.
+
+HIGHLIGHTS
+
+Pros
+ + On up-to-date hardware where mysql can be used comfortably, this
+ module will have better performance than the other db choices
+ (according to our tests).
+ + Its often possible to recover the mysql database from internal
+ inconsistencies. The other db choices do not support repair
+ (gnunet-check cannot fix problems internal to the dbmgr!).
+ For example, we have seen several cases where power failure
+ has ruined a gdbm database beyond repair.
+ + much faster (for one of the key benchmarks -- content migration
+ -- we have measure mysql taking 2s for an operation where
+ sqlite takes 150s).
+Cons
+ - Memory usage (Comment: "I have 1G and it never caused me trouble")
+ - Manual setup
+
+MANUAL SETUP INSTRUCTIONS
+
+ 1) in /etc/gnunet.conf, set
+ DATABASE = mysql
+
+ 2) Then access mysql as root,
+ $ mysql -u root -p
+ and do the following. [You should replace $USER with the username
+ that will be running the gnunetd process].
+
+ CREATE DATABASE gnunet;
+ GRANT select,insert,update,delete,create,alter,drop,create temporary tables
+ ON gnunet.* TO $USER@localhost;
+ SET PASSWORD FOR $USER@localhost=PASSWORD('$the_password_you_like');
+ FLUSH PRIVILEGES;
+
+ 3) In the $HOME directory of $USER, create a ".my.cnf" file
+ with the following lines
+
+ [client]
+ user=$USER
+ password=$the_password_you_like
+
+ Thats it. Note that .my.cnf file is a security risk unless its on
+ a safe partition etc. The $HOME/.my.cnf can of course be a symbolic
+ link. Even greater security risk can be achieved by setting no
+ password for $USER. Luckily $USER has only priviledges to mess
+ up GNUnet's tables, nothing else (unless you give him more,
+ of course).
+
+ 4) Still, perhaps you should briefly try if the DB connection
+ works. First, login as $USER. Then use,
+
+ $ mysql -u $USER
+ mysql> use gnunet;
+
+ If you get the message "Database changed" it probably works.
+
+ [If you get "ERROR 2002: Can't connect to local MySQL server
+ through socket '/tmp/mysql.sock' (2)" it may be resolvable by
+ "ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock"
+ so there may be some additional trouble depending on your mysql setup.]
+
+ 5) If you want to run the testcases, you must create a second
+ database "gnunetcheck" with the same username and password.
+ This database will then be used for testing ("make check").
+
+
+REPAIRING TABLES
+
+- Its probably healthy to check your tables for inconsistencies
+ every now and then, especially after system crashes.
+- If you get odd SEGVs on gnunetd startup, it might be that the mysql
+ databases have been corrupted.
+- The tables can be verified/fixed in two ways;
+ 1) by shutting down mysqld (mandatory!) and running
+ # myisamchk -r *.MYI
+ in /var/lib/mysql/gnunet/ (or wherever the tables are stored).
+ Another repair command is "mysqlcheck". The usable command
+ may depend on your mysql build/version. Or,
+ 2) by executing
+ mysql> REPAIR TABLE gn090;
+
+
+PROBLEMS?
+
+If you have problems related to the mysql module, your best friend is
+probably the mysql manual. The first thing to check is that mysql is
+basically operational, that you can connect to it, create tables,
+issue queries etc.
+