initialsetup wizard: Unable to create the database

Application Name: Windows 7 Demo Installation

Question: Hello, I am trying to install a test openmrs server on my home laptop (windows 7 64bit). I couldn’t get the standalone application to work, and I didn’t want to try some of the possible fixes for that, so I was trying to install tomcat + mysql. I have done only some web development before, but not with java.

I have tomcat running with openmrs.war, and am trying to run the openmrs initialsetup wizard. I am having an issue just like this thread, but none of the solutions there seem to fix it for me.

I get an error message: Unable to create the database. The password might be incorrect or the database is not started. ???Error executing sql: create database if not exists '?' default character set utf8 - Could not create connection to database server. Attempted reconnect 3 times. Giving up.???

I am able to connect to the mysql service (running on the same computer) using this command: > "c:\Program Files\MySQL\MySQL Server 5.7\bin\mysql.exe" --port=3306 --host= --user=root --password --protocol=TCP and I can create, delete databases and users without issue.

Does anyone have any help or suggestions?

Two specific questions:

  1. How can I turn on logging concerning the database connection, or where can I see the log?
  2. Someone in the thread mentioned above said “OpenMRS doesn’t use the MySQL JDBC Driver. It communicates directly with MySQL, using the username / password from the runtime properties file.”. If that’s the case, why does the database connection line say: jdbc:mysql://localhost:3306/@DBNAME@?autoReconnect=true&sessionVariables=storage_engine=InnoDB&useUnicode=true&characterEncoding=UTF-8
1 Like

Hello @mdg583 Sorry you’re having problems installing OpenMRS. I know how frustrating this is. Ok, so I tried pretty much everything and the same error kept reappearing right until I used these versions together: Tomcat 6.0.29 MySQL 5.5.46 JDK 6 And all of a sudden, all my problems disappeared and it was all rainbows and butterflies… Hope this helps you Please let me know if it did Take care, Hossam

Thank you Hossam, this worked.

First I installed java 1.6.0_45, but it still didn’t work. Then I downgraded mysql from mysql 5.7.12 to 5.5.49, and then I got past this problem.

However I seem to be having another problem: the setup process has stalled at 100% and the output console is showing these errors: "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1" java.lang.OutOfMemoryError: PermGen space Along with a bunch of “Exception in thread” errors. But I suspect this is unrelated to the original problem.

However I just restarted tomcat, and I seem to be able to access and use the openmrs system.

1 Like

Did you do that?

No, I’m actually running tomcat using startup.bat, and I created a file: setenv.bat which is looked for by catalina.bat and put this in it:

@echo off set JAVA_HOME=c:\Program^ Files\Java\jdk1.6.0_45
set JAVA_OPTS=-Dfile.encoding=UTF-8 -Xms128m -Xmx1024m -XX:PermSize=64m -XX:MaxPermSize=256m

Now the permgen errors seem to have gone away. I’m not sure if this is the best solution though, since based on things online this error could be caused by a kind of memory leak.