Documentation for Crowd 1.0. Documentation for other versions of Crowd is available too.
To connect Crowd to MySQL,
common/lib/
directory. NOTE: Do not place the Debug Driver (mysql-connector-java-3.x.x-bin-g.jar) on the CLASSPATH
as this can cause issues (JRA-8674).<Context path="/crowd" docBase="../../crowd-webapp" debug="0"> <Resource name="jdbc/CrowdDS" auth="Container" type="javax.sql.DataSource" username="[enter db username here]" password="[enter db password here]" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/crowddb?autoReconnect=true&useUnicode=true&characterEncoding=latin1" [ delete the minEvictableIdleTimeMillis, timeBetweenEvictionRunsMillis and maxActive params here ] /> <Manager className="org.apache.catalina.session.PersistentManager" saveOnRestart="false"/> </Context>
create database crowddb character set utf8;
. If you don't specify character set utf8 you risk getting 'Data truncation: Data too long for column' errors.
MySQL closes idle connection after 8 hours, so the autoReconnect=true
is necessary to tell the driver to reconnect
*For MySQL set:* hibernate.dialect=org.hibernate.dialect.MySQLDialect *For MySQL with InnoDB set:* hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect *For MySQL with MyISAM set:* hibernate.dialect=org.hibernate.dialect.MySQLMyISAMDDialect
If you do not wish to edit this file and run the build script, you can edit the jdbc.properties (which the above script modifies) directly. The jdbc.properties file is located here: crowd-webapp\WEB-INF\classes\jdbc.properties
, modify the file to the following:
# - Crowd Configuration Options hibernate.connection.datasource=java\:comp/env/jdbc/CrowdDS hibernate.dialect=org.hibernate.dialect.MySQLDialect hibernate.transaction.factory_class=org.hibernate.transaction.JDBCTransactionFactory ...
You should now have an application server configured to connect to a database, and Crowd configured to use the correct database. Now start up Crowd and watch the logs for any errors.