Page 1 of 1

Usage of MySQL DB not working - no connection

PostPosted:Thu Aug 08, 2013 10:22 pm
by Fistandantilus
Hi,

I have a Synology NAS here where also some MySQL databases are running.
I would also like to store the openKM db there.

Therefore I have done the following:

1. added the these lines to openkm.cfg
Code: Select all
hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
hibernate.hbm2ddl=create
2. created db and user
Code: Select all
CREATE DATABASE okmdb DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_bin;
CREATE USER openkm@localhost IDENTIFIED BY 'admin';
GRANT ALL ON okmdb.* TO openkm@localhost WITH GRANT OPTION;
3. changed the server.xml
Code: Select all
    <Resource name="jdbc/OpenKMDS" auth="Container" type="javax.sql.DataSource"
            maxActive="100" maxIdle="30" maxWait="10000" validationQuery="select 1 from INFORMATION_SCHEMA.SYSTEM_USERS"
            username="openkm" password="admin" driverClassName="com.mysql.jdbc.Driver"
            url="jdbc:mysql://192.168.1.100:3306/okmdb?autoReconnect=true&useUnicode=true&characterEncoding=UTF8"/>
When I now try to open the portal I get this error:
Class: org.apache.jasper.JasperException
Message: javax.servlet.ServletException: com.openkm.core.DatabaseException: Cannot open connection
Date: Fri Aug 09 00:12:02 CEST 2013
Error Log shows:
0:0:0:0:0:0:0:1%0 - - [09/Aug/2013:00:12:02 +0200] "GET /OpenKM HTTP/1.1" 302 -
0:0:0:0:0:0:0:1%0 - - [09/Aug/2013:00:12:02 +0200] "GET /OpenKM/ HTTP/1.1" 302 -
0:0:0:0:0:0:0:1%0 - - [09/Aug/2013:00:12:02 +0200] "GET /OpenKM/frontend/index.jsp HTTP/1.1" 302 -
0:0:0:0:0:0:0:1%0 - - [09/Aug/2013:00:12:02 +0200] "GET /OpenKM/login.jsp HTTP/1.1" 500 1201
0:0:0:0:0:0:0:1%0 - - [09/Aug/2013:00:12:03 +0200] "GET /OpenKM/css/desktop.css HTTP/1.1" 304 -
Connecting to the db using the credentials through another application (Sequel Pro) is working.
Using OS X.

Btw running the package as downloaded is working fine. But I need to access the db from 3 different machines.

best regards,
F.

Re: Usage of MySQL DB not working - no connection

PostPosted:Thu Aug 08, 2013 10:52 pm
by Fistandantilus
OK, got one step further.
After changing server.xml to
<Resource name="jdbc/OpenKMDS" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000" validationQuery="select 1"
username="openkm" password="admin" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://192.168.1.100:3306/okmdb?autoReconnect=true&useUnicode=true&characterEncoding=UTF8"/>
I now get this error:
Class: org.apache.jasper.JasperException
Message: javax.servlet.ServletException: com.openkm.core.DatabaseException: could not execute query
Date: Fri Aug 09 00:47:23 CEST 2013
Looks like at least connection was successful now?

Re: Usage of MySQL DB not working - no connection

PostPosted:Thu Aug 08, 2013 11:00 pm
by Fistandantilus
Looks like it is working now. Just had to set hibernate.hbm2ddl=create , deleted repository folder and restarted everything :)

Re: Usage of MySQL DB not working - no connection

PostPosted:Fri Aug 09, 2013 4:23 pm
by jllort
The sequence of actions is important. Good work.