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