Cannot connect to MYSQL

OpenKM has many interesting features, but requires some configuration process to show its full potential.
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.
lnovoa
Expert Boarder
Expert Boarder
Posts: 119
Joined: Tue Mar 27, 2018 8:00 am

Re: Cannot connect to MYSQL

Post by lnovoa »

Hi!,
try executed this on database:

Code: Select all

GRANT ALL ON okmdb.* TO UserDatabase@localhost WITH GRANT OPTION;
UserDatabase: you have to modify it.
cdc
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: Thu May 24, 2018 5:22 am

Re: Cannot connect to MYSQL

Post by cdc »

Did that
Still no success.
lnovoa
Expert Boarder
Expert Boarder
Posts: 119
Joined: Tue Mar 27, 2018 8:00 am

Re: Cannot connect to MYSQL

Post by lnovoa »

What version of mysql do you have installed?
cdc
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: Thu May 24, 2018 5:22 am

Re: Cannot connect to MYSQL

Post by cdc »

Server version: 8.0.11 MySQL Community Server - GPL
lnovoa
Expert Boarder
Expert Boarder
Posts: 119
Joined: Tue Mar 27, 2018 8:00 am

Re: Cannot connect to MYSQL

Post by lnovoa »

That is the cause, the connection driver with the mysql supports up to the previous version.
You have to install the version mysql 5.7.22 and uninstall the current one.

Once done, do the following steps:

1. Stop openkm
2. execute the following as the root user in the bbdd:

Code: Select all

CREATE DATABASE okmdb DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_bin;
CREATE USER openkm@localhost IDENTIFIED BY 'password!!';
GRANT ALL ON okmdb.* TO openkm@localhost WITH GRANT OPTION;
3. You delete the tomcat repository directory
4. change in the openkm.cfg
hibernate.hbm2ddl = none -> hibernate.hbm2ddl = create
5. Start tomcat
jllort
Moderator
Moderator
Posts: 11598
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Cannot connect to MYSQL

Post by jllort »

About MySQL version 8 here some clues about what might be the reason of the issue:
https://docs.openkm.com/kcenter/view/ok ... oting.html
cdc
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: Thu May 24, 2018 5:22 am

Re: Cannot connect to MYSQL

Post by cdc »

Thanks alot!
It's working now.
shinus
Fresh Boarder
Fresh Boarder
Posts: 8
Joined: Thu Jun 11, 2020 9:21 pm

Re: Cannot connect to MYSQL

Post by shinus »

hi cdc, can you please let me know how you orted this, i am having the same issue...with mysql 8.0.20, so did you uninstall and install new mysql? an older version?
if so do you have to do the whole process of tomcat installation of again? my tomcat installation is taking huge time..and the extras..
jllort
Moderator
Moderator
Posts: 11598
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Cannot connect to MYSQL

Post by jllort »

When you start the application in windows usually it takes a lot of time exploding the OpenKM.war file ( I suggest take a look at the catalina.log file to check the process, in the installation folder there's extras folder what comes with mtail application what it is useful for it purpose ).

Also, I suggest take a look at troubleshooting in the OpenKM MySQL documentation section https://docs.openkm.com/kcenter/view/ok ... oting.html
folksur
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: Thu Sep 02, 2021 8:17 pm

Re: Cannot connect to MYSQL

Post by folksur »

I am able to connect to MYSQL through Command Line. And bin folder is present in the PATH.surveyzop
jllort
Moderator
Moderator
Posts: 11598
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Cannot connect to MYSQL

Post by jllort »

* What is the error shown in the openkm.log? can you share?
* Check the connection URL ( localhost, port, user, password ), ensure everything is right in the server.xml
* Check if you have enabled SSL or is shown some error in this direction in the openkm.log file ( log usually show relevant information about errors )
* Are OpenKM and MySQL installed on the same server?
Post Reply