Show last authors
1 1 MySQL Installation
2
3 #toc("" "" "")
4
5 1.1 Installation Steps
6
7 Follow these instructions:
8
9 * Download and install [MySQL>http://www.mysql.com/]
10 ** Note that XWiki will not work with MySQL version 4.0 or lower as one library we're using (C3P0) is not compatible with MySQL 4.x.
11 * Start the MySQL server. You can do that in several ways. For example:
12 {code}
13 mysqld --console
14 {code}
15 * Create the wiki database. You can do that in several ways. For example:
16 {code}
17 mysql -u root -e "create database xwiki"
18 {code}
19 * Give all privileges to the xwiki user for accessing the xwiki database. You can do that in several ways. For example (if you get connections problems try localhost instead of the IP address below):
20 {code}
21 mysql -u root -e "grant all privileges on xwiki.* to xwiki@127.0.0.1 identified by 'xwiki'"
22 {code}
23 * You need to have the MySQL JDBC Driver JAR (named <tt>mysql-connector-java*.jar</tt> installed in XWiki's WAR file. If this file isn't present in XWiki's <tt>WEB-INF/lib</tt> diredctory you'll need to download it and copy it there. You can download it from the [MySQL Connector/J Driver page>http://www.mysql.com/products/connector/j/] or directly from the [Maven Central Repository>http://repo1.maven.org/maven2/mysql/mysql-connector-java/].
24 * Now you need to tell XWiki to use MySQL. To do this, edit the <tt>WEB-INF/hibernate.cfg.xml</tt> file where you have expanded the XWiki WAR file and replace the matching properties with the following ones:
25 {code}
26 <property name="connection.url">jdbc:mysql://localhost/xwiki</property>
27 <property name="connection.username">xwiki</property>
28 <property name="connection.password">xwiki</property>
29 <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
30 <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
31 {code}
32
33 Note: By default MySQL only accepts packets smaller than 1MB. If you get the "Packet for query is too large (max_allowed_packet)" error then see the [Packet too large error page>http://dev.mysql.com/doc/refman/5.0/en/packet-too-large.html]. For example to increase the packet size to 32M you could start the MySQL server with:
34 {code}
35 mysqld --console --max_allowed_packet=32M
36 {code}
37
38 1.1 Troubleshooting
39
40 1.1.1 Can't create test file
41
42 When running <tt>mysqld --console</tt> you may get the following (especially if you're on Mac):
43
44 {code}
45 071111 17:20:53 [Warning] Can't create test file /usr/local/mysql-5.0.45-osx10.4-i686/data/Vincent.lower-test
46 071111 17:20:53 [Warning] Can't create test file /usr/local/mysql-5.0.45-osx10.4-i686/data/Vincent.lower-test
47 mysqld: Can't change dir to '/usr/local/mysql-5.0.45-osx10.4-i686/data/' (Errcode: 13)
48 071111 17:20:53 [ERROR] Aborting
49 {code}
50
51 To start MySQL run the following instead:
52
53 {code}
54 sudo /usr/local/mysql/bin/mysqld_safe --user=mysql
55 {code}

Get Connected