Show last authors
1 1 MySQL Installation
3 #toc("" "" "")
5 1.1 Installation Steps
7 Follow these instructions:
9 * Download and install [MySQL>]
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@ 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>] or directly from the [Maven Central Repository>].
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}
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>]. 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}
38 1.1 Troubleshooting
40 1.1.1 Can't create test file
42 When running <tt>mysqld --console</tt> you may get the following (especially if you're on Mac):
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}
51 To start MySQL run the following instead:
53 {code}
54 sudo /usr/local/mysql/bin/mysqld_safe --user=mysql
55 {code}

Get Connected