]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - doc/INSTALL.mysql
updated config.ini settings
[SourceForge/phpwiki.git] / doc / INSTALL.mysql
1 FIXME: these instructions are slightly broken.
2
3 Installing phpwiki with MySQL 
4 -----------------------------
5
6 This assumes that you have a working MySQL server and client setup.
7 Installing MySQL is beyond the scope of this document.
8 For more information on MySQL go to http://www.mysql.org/
9
10 1. If you do not have a suitable database already, create one (using
11    the root or other privileged account you set up when MySQL was
12    installed.)
13
14         mysqladmin -uuser -ppassword create phpwiki
15
16 2. If necessary create a user for that database which has the rights
17    to select, insert, update, delete (again using the root
18    administration account).
19
20         mysql -uuser -ppassword phpwiki
21
22    A MySQL grant statement for this user would look like this:
23
24         GRANT select, insert, update, delete, lock tables 
25         ON phpwiki.*
26         TO wikiuser@localhost
27         IDENTIFIED BY 'password';
28
29         Upgrade note: The mysql wikiuser needs to have the LOCK TABLES
30         privilege granted for all the wiki tables (PAGE, VERSION,
31         LINK, RECENT and NONEMPTY). This is a relatively new privilege type.
32
33 3. Create tables inside your database (still using the root account).
34
35         mysql -uuser -ppassword phpwiki < schemas/mysql.sql
36
37    Note: the user specified in this command needs to have the rights
38          to drop and create tables. Use the same user as in step 1.
39
40    If you are using MySQL 3.21.x or earlier the script may issue an
41    error. In that case remove existing tables manually and delete
42    the "drop tables" lines from schemas/mysql.sql - it should work now
43
44 4. Edit the DATABASE settings in config/config.ini to reflect your settings.
45
46         a) DATABASE_TYPE should be set to 'SQL' or 'ADODB'.
47         b) DATABASE_DSN should be set to something like
48            'mysql://guest@unix(/var/lib/mysql/mysql.sock)/phpwiki".
49            (where 'phpwiki' is the mysql database name.)
50         c) Note that if you set DATABASE_PREFIX to a 
51            non-empty string, you will have to edit
52            schemas/mysql.sql before you perform step
53            three (above).  (Sorry.)
54
55 That's it. phpwiki should now work. DATABASE_DIRECTORY,
56 DATABASE_DBA_HANDLER and DATABASE_TIMEOUT are ignore for mysql.
57
58 If you run into problems then check that your MySQL-user has
59 the necessary access rights for the phpwiki tables.
60
61 Hint for Linux-Debian users: it may be necessary to load the MySQL
62 module first: insert the following line in config.php before
63 "mysql.php" gets included:
64 if (!extension_loaded("mysql"))  { dl("mysql.so"); }
65
66
67 Upgrading a MySQL phpwiki
68 -------------------------
69
70 If schemas/mysql.sql has changed for your old phpwiki installation, 
71 you can either create missing tables manually and ALTER the changed tables 
72 manually. 
73 Or you can run ?action=upgrade (also from "Upgrade" at PhpWikiAdministration), but 
74 then your database user needs the necessary ALTER and CREATE permissions. You 
75 might change these temporarly in your config.ini.
76 action=upgrade also brings all changed pgsrc files up-to-date.
77
78 /Reini and Arno ahollosi@mail.com
79
80 $Id: INSTALL.mysql,v 1.5 2004-06-28 13:54:55 rurban Exp $