InstallationMySQL

Version 1.16 by Vincent Massol on 2007/11/11
Warning: For security reasons, the document is displayed in restricted mode as it is not the current version. There may be differences and errors due to this.

MySQL Installation

Invalid macro parameters used for the [toc] macro. Cause: [Failed to validate bean: [must be greater than or equal to 1]]. Click on this message for details.

Installation Steps

Follow these instructions:

  • Download and install MySQL
    • 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.
  • Start the MySQL server. You can do that in several ways. For example:
mysqld --console
  • Create the wiki database. You can do that in several ways. For example:
mysql -u root -e "create database xwiki"
  • 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):
mysql -u root -e "grant all privileges on xwiki.* to xwiki@127.0.0.1 identified by 'xwiki'"
  • You need to have the MySQL JDBC Driver JAR (named mysql-connector-java*.jar installed in XWiki's WAR file. If this file isn't present in XWiki's WEB-INF/lib 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.
  • Now you need to tell XWiki to use MySQL. To do this, edit the WEB-INF/hibernate.cfg.xml file where you have expanded the XWiki WAR file and replace the matching properties with the following ones:
<property name="connection.url">jdbc:mysql://localhost/xwiki</property>
<property name="connection.username">xwiki</property>
<property name="connection.password">xwiki</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>

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:

mysqld --console --max_allowed_packet=32M

Troubleshooting

Can't create test file

When running mysqld --console you may get the following (especially if you're on Mac):

071111 17:20:53 [Warning] Can't create test file /usr/local/mysql-5.0.45-osx10.4-i686/data/Vincent.lower-test
071111 17:20:53 [Warning] Can'
t create test file /usr/local/mysql-5.0.45-osx10.4-i686/data/Vincent.lower-test
mysqld: Can't change dir to '/usr/local/mysql-5.0.45-osx10.4-i686/data/' (Errcode: 13)
071111 17:20:53 [ERROR] Aborting

To start MySQL run the following instead:

sudo /usr/local/mysql/bin/mysqld_safe --user=mysql
Tags:
   

Get Connected