Difference between revisions of "MySQL - OpenKM 6.2"
From OpenKM Documentation
m (moved MySQL-OpenKM 6.2 to MySQL - OpenKM 6.2) |
|||
Line 16: | Line 16: | ||
== Database creation == | == Database creation == | ||
− | + | Check if your MySQL installation has InnoDB engine enabled: | |
− | + | <source lang="bash"> | |
+ | $ mysql -h localhost -u root -p | ||
+ | mysql> show engines; | ||
+ | </source> | ||
+ | |||
+ | Edit /etc/mysql/my.cnf and under [mysqld] section in your ini file, add: | ||
+ | |||
+ | <source lang="bash"> | ||
+ | default-storage-engine = innodb | ||
+ | </source> | ||
+ | |||
+ | {{Note|Starting with OpenKM 6.0, only one database is needed.}} | ||
+ | |||
+ | Now create databases and user: | ||
<source lang="sql"> | <source lang="sql"> |
Revision as of 17:26, 7 December 2012
In this OpenKM release you can create the databases automatically configuring the hibernate.dialect and hibernate.hbm2ddl properties in OpenKM.cfg.
hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
hibernate.hbm2ddl=create
Once the tables are created, OpenKM will automatically change the hibernate.hbm2ddl property from create to none.
More info about this at:
Database creation
Check if your MySQL installation has InnoDB engine enabled:
$ mysql -h localhost -u root -p
mysql> show engines;
Edit /etc/mysql/my.cnf and under [mysqld] section in your ini file, add:
default-storage-engine = innodb
Starting with OpenKM 6.0, only one database is needed. |
Now create databases and user:
DROP DATABASE IF EXISTS okmdb;
CREATE DATABASE okmdb DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_bin;
CREATE USER openkm@localhost IDENTIFIED BY '*secret*';
GRANT ALL ON okmdb.* TO openkm@localhost WITH GRANT OPTION;
More info at MySQL: Case Sensitivity in String Searches.
Tomcat datasources
$ vim $TOMCAT_HOME/conf/server.xml
<Resource name="jdbc/OpenKMDS" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000" validationQuery="select 1"
username="openkm" password="*secret*" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/okmdb?autoReconnect=true&useUnicode=true&characterEncoding=UTF8"/>
Login configuration
$ vim $TOMCAT_HOME/OpenKM.xml
<security:authentication-manager alias="authenticationManager">
<security:authentication-provider>
<security:password-encoder hash="md5"/>
<security:jdbc-user-service
data-source-ref="dataSource"
users-by-username-query="select usr_id, usr_password, 1 from OKM_USER where usr_id=? and usr_active='T'"
authorities-by-username-query="select ur_user, ur_role from OKM_USER_ROLE where ur_user=?"/>
</security:authentication-provider>
</security:authentication-manager>