Openmrs not connecting with DB.

Openmrs Showing this error: "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.???"

Please note: DB creadentials is good. I double checked it. Tomcat Version: Apache Tomcat/8.5.27 JVM: 9.0.4+11 Widows: 10

Any Ideas?

1 Like

Do you remember your MySQL “root password”? type it where you are asked for a password.

Tried. Same result

you are using which version of mysql ? 5.6 version is recommended

Even higher versions of MySQL should work fine.

u must first set a password for your mysql root account. and then use it as a password . make sure u start the mysql databse before u do the installation.

u can probably try the standalone wc comes wih every thing packaged and set for u
u can also try the sdk

mysql server version 8.0.11

Same issue with me here. Standalone 2.1.3, tomcat 9, mysql 8.0.1. I have entered the root password but not way. I even reinstalled mysql and made sure I set another password still same result. Its either the standalone has inherent issues or the mysql or the tomcat.

What is the username for the “root” password?

The standalone version has an embedded mysql and tomcat. Try unzip a fresh version of the standalone and run it again.

which set up type are you running for your standalone?

I want to use the enterprise war so as to deployed over the wireless network for client computers to access without starting an instance of the application on the server. For the embedded tomcat and SQL in the standalone version, they can’t be accessed by client PCs unless the application has been started on the server for it to invoke the embedded tomcat and SQL.

Something is definitely wrong. I spent 2 whole nights and can’t get around the issue of password.

Uninstalled the mysql 8.0.13 and deleted related folders in program files and program data. Restarted and installed mysql 5.6.42. Now its working… after 48hrs of non night sleep though. My hypothesis is that the components mysql 8, tomcat 9 and OMRS 2.x do not mix.

1 Like

sorry about that blocker but still it’s great that you have overcome it. Please could you share the steps you took to get unblocked to help someone out there who may be having the same problem. :smile:

MySQL 8 updated the authentication mechanism:

Unfortunately I haven’t figured out how to make it work without downgrading the authentication mechanism in MySQL.

I created a separate user in MySQL identified with mysql_native_password (from the openmrs-core repo) using something like: CREATE USER ‘’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘;’

I then granted appropriate privileges, and using the Advanced setup to have openMRS use the “new” user.

The most secure route would be to also create the OpenMRS database and ONLY grant the user privileges on that database (in the Advanced Setup you still create the tables automatically).

I am new to the forum, so apologies if I am breaking any rules.

Well I tried downgrading the authentication but still ran into issues. The most definite fix to this is downgrading the mysql version.

1 Like

Once you join this community your are a member whose opinion counts. Feel free to contribute and make openmrs the best open source.

Was the issue sorted out? if not share the output on the pastebin

Yes the issue was resolved after downgrading to mysql 5.x. Installation was successful.