• Could not create connection to database server

  • Problems with installing OpenKM? No problemo, the solution is closer than you think.
Problems with installing OpenKM? No problemo, the solution is closer than you think.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #46026  by Uli
 
Hi,

I'm trying to run openKM, but...

Plattform: Mac HighSierra, MySQL 8.0.1.1

I've downloaded the jar file, installed everything, wrote "mysql" in the installation process, where the script asks for the db type. I added the SQL-Commands to my phpAdmin and I wanted to login (http://127.0.0.1:8080/OpenKM/login.jsp or http://localhost:8080/OpenKM/login.jsp) - BUT an error came up "javax.servlet.ServletException: com.openkm.core.DatabaseException: Cannot open connection". I went thru the whole board here, but....

I've:
- changed hibernate.hbm2ddl=none -> hibernate.hbm2ddl=create in the conf file
- deleted repository directory before starting the server again

openkm.log: shows always the same
Code: Select all
2018-06-04 11:38:13,126 [localhost-startStop-1] [] INFO  c.o.servlet.RepositoryStartupServlet - *** Initialize language detection engine... ***
2018-06-04 11:38:17,911 [localhost-startStop-1] [] WARN  o.h.util.JDBCExceptionReporter - SQL Error: 0, SQLState: null
2018-06-04 11:38:17,912 [localhost-startStop-1] [] ERROR o.h.util.JDBCExceptionReporter - Cannot create PoolableConnectionFactory (Could not create connection to database server. Attempted reconnect 3 times. Giving up.)
server.xml
Code: Select all
<Resource name="jdbc/OpenKMDS" auth="Container" type="javax.sql.DataSource"
          maxActive="100" maxIdle="30" maxWait="10000" validationQuery="select 1"
          username="MyUser" password="MyPasswort" driverClassName="com.mysql.jdbc.Driver"
          url="jdbc:mysql://127.0.0.1:3306/okmdb?useSSL=false&amp;autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=UTF8"/>
or
Code: Select all
<Resource name="jdbc/OpenKMDS" auth="Container" type="javax.sql.DataSource"
          maxActive="100" maxIdle="30" maxWait="10000" validationQuery="select 1"
          username="MyUser" password="MyPasswort" driverClassName="com.mysql.jdbc.Driver"
          url="jdbc:mysql://localhost:3306/okmdb?useSSL=false&amp;autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=UTF8"/>
(MyUser and MyPasswort are just used for this post)

works fine with:
/usr/local/mysql-8.0.11-macos10.13-x86_64/bin/mysql -u MyUser -p MyPasswort --host=127.0.0.1 --port=3306 okmdb
and
/usr/local/mysql-8.0.11-macos10.13-x86_64/bin/mysql -u MyUser -p MyPasswort okmdb

Before I edit the files, I stopped the server (sudo shutdown.sh) , emptied therepository directory. After that, I restarted the server again (sudo catalina.sh start or sudo startup.sh)

here are the logfiles:
https://dasat.com/uli/catalina.2018-06-04.log.txt
https://dasat.com/uli/localhost.2018-06-04.log.txt
https://dasat.com/uli/openkm.log.txt

Thanks for help :)

Uli
 #46039  by jllort
 
I suggest installing with mysql version 5.7, seems with version 8 have changed some things and we must test it for better understanding ( might be problems with jdbc driver into $TOMCAT_HOME/lib I'm not sure about it, should be done some testing ). Also you can try with mariadb on linux OS I think might be better option rather MySQL.

Here https://bugs.mysql.com/bug.php?id=86221 something I found about this kind of error.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.